73 Posted Topics
Re: yes, that's the way [CODE] a=3; b=4; printf("%d/%d",a,b); [/CODE] | |
Re: [CODE] //Function Protoype char* stringCat(char *pWord, char *pTemp); //Function call in main stringCat(stringCat(word, ": "), temp); printf("\n\nConcatenation: \"%s\".", word); printf("\n\n"); //Actual Function char* stringCat(char *pWord, char *pTemp) { int i; int j; for (i = 0; pWord[i] != '\0'; i++); // Notice the ; for (j = 0; pTemp[j] != … | |
Re: Its easier to make such program using If-else, the logic could be quite simple.. think a bit... | |
Re: >>I'm just unsure how to return the values from the structure with designating a matrix like this: [code] int matrixGetElement (Matrix* m, int r, int c) //that is without having the "m" { } [/code] Sorry! could'nt get the problem. | |
Re: Try this one also.. [CODE] # include <stdio.h> int main(){ int a=10,b=3,reminder; // suppose you want a%b. reminder = a -(a/b)*b; printf("\n\n Reminder of %d/%d is %d",a,b,reminder); return 0; } [/CODE] This will also work like % operator.. | |
Re: Just learn the use of strcpy, strcat and itoa function.. and it would be quite easy to implement such code..:) Have a Look.. [CODE] # include <stdio.h> # include <string.h> # include <stdlib.h> int main() { char fname[12]; char num[3]={"00"}; int i; for(i=1;i<=20;i++) { strcpy(fname,"data-"); if(i<10) itoa(i,&num[1],10); else itoa(i,num,10); strcat(fname,num); … | |
Re: How much i could understand, i think you are trying to do this.. [CODE] #include <stdlib.h> #include <stdio.h> int main () { int Tab[5][3]={0}, i, j, GrandA = 0, GrandB = 0, GrandC = 0,Sum; for(i = 0; i < 3; i++) { for(j = 0; j < 5; j++) … | |
Re: Try this one also... [CODE] #include<conio.h> // try to avoid conio.h #include<stdio.h> #include<stdlib.h> //Protoype of the functions void read(char *fn); void write(char *fn); void append(char *fn); int main() // don't use void with main { char fn[20]; int ch; printf("\t\tEnter the name of the file\n\t\t"); scanf("%s",&fn); //Actual Processing: do { … | |
Re: [QUOTE=Lerilaine;1394815]One little question bit off-toppic. I get an array of chars ended with a binary zero. I need to count how many chars do I have in the array. Can I check the ending like this? [CODE]while(s[i]!=0) { length++; i++}[/CODE] I'm a bit confused about what a binary zero is. … | |
Re: well could'nt find any problem in your code... its happening maybe because of scanf function... | |
| |
Write a 'C' Function to combine two singly connected linked lists in the following manner. Suppose one list is "L" which can be given by L=(l0,l1,.....,lm) and the other list is "M" where "M" can be expressed as M=(m0,m1,......,mn) where each li,mi represents one node in the respective lists. For … | |
Hello Friends I want to pass a Double Dimension Array to a Function using Pointers... Right Now i am doing this.. [CODE] # include <stdio.h> void show(int *,int,int); int main() { int a[3][3]={1,2,3, 4,5,6, 7,8,9}; show(a[0],3,3); return(0); } void show(int *p,int row,int col) { int i,j; printf("\n\n\n"); for(i=0;i<row;i++) { for(j=0;j<col;j++) … | |
Please give Free download links of Latest and Best C/C++ Compilers for Windows... | |
Re: Here you went Wrong !! Are you sure that you will input 80 char long string every time... [CODE] while(i!=80) [/CODE] It should be like [CODE] while(array[i]!='\0') // A string in c comes to end when it reaches '\0' [/CODE] Also you are running a never ending while loop because … | |
Re: [QUOTE=Jollyyy100;1383609]sir, what do you mean by specifying the path, could you give me an example and i checked the folder it does not have my work saved in it... thank you[/QUOTE] Specifying the path means telling the compiler where you want your File on Disk... like: ofp = fopen("D:\\xyz\\myprogram.txt", "w"); … | |
Re: [QUOTE=berwick53;1378406]to make a char array of 2 columns containing strings 49 characters long and 10 rows contaning strings also 49 characters long. is this correct char ArrayName[10][50][2][50] ??[/QUOTE] what i get is you want a char array that have 10 rows and each row contains a 49 char string... then … | |
Re: [CODE] /* program tht replaces two or more consecutive blanks in a string by a single blank.. */ # include<stdio.h> int main(){ int i; char s[50],*p,*q; printf("\n\n :"); gets(s); for(i=0;s[i];i++){ if(s[i]==32){ p=&s[i+1]; while(*p && *p==32){ q=p; while(*q){ *q=*(q+1); q++; } } } } printf("\n\n :%s",s); return 0; } [/CODE] | |
[COLOR="Green"]Hello Friends... i made this Queue Program in c and its working good.. But I want to make it circular Queue please give some ideas..[/COLOR] [CODE] # include <stdio.h> # include <conio.h> # include <stdlib.h> # include <string.h> # define QSIZE 5 typedef struct{ int head,tail; char names[QSIZE][30]; }QUEUE; void … | |
[B]Hello Friends.. I need suggestions to make my this program better...[/B] [COLOR="Red"][B]Implementation of a STACK(containing names) as an array, with its basic operations PUSH,POP & SHOW[/B]..[/COLOR] [CODE] # include <stdio.h> # include <conio.h> # include <string.h> # include <process.h> # define STACKSIZE 5 typedef struct{ int size; char names[STACKSIZE][20]; }STACK; … | |
Re: [QUOTE=nathanurag;1109377][CODE]#include<stdio.h> int main() { int i,j,k,c; char s[1000]; //array to store the input string for(i=0;(c=getchar())!='.';++i) //string to be ended with '.' { s[i]=c; for(j=0;j<=i;++j) { if((s[j]==s[j-1])&&(s[j]=='\n' || s[j]=='\t' ||s[j]==' ')) { j=j-1; } } for(k=0;k<=i;++k) printf("%c", s[k]); } return 0; } [/CODE] I am trying to create a program that … |
The End.