73 Posted Topics

Member Avatar for harikrishna439

yes, that's the way [CODE] a=3; b=4; printf("%d/%d",a,b); [/CODE]

Member Avatar for sharathg.satya
0
111
Member Avatar for ram619
Member Avatar for arineon

[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] != …

Member Avatar for darkbreaker
0
150
Member Avatar for hqrtt

Its easier to make such program using If-else, the logic could be quite simple.. think a bit...

Member Avatar for Snehamathur
0
124
Member Avatar for gahhon
Member Avatar for TheBaby7591

>>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.

Member Avatar for vinitmittal2008
0
182
Member Avatar for Snehamathur

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..

Member Avatar for Snehamathur
0
187
Member Avatar for becka221

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); …

Member Avatar for vinitmittal2008
0
152
Member Avatar for Defoe

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++) …

Member Avatar for Defoe
0
109
Member Avatar for indrajeet6

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 { …

Member Avatar for Perry31
0
230
Member Avatar for harunosakura

[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. …

Member Avatar for Lerilaine
0
199
Member Avatar for gahhon

well could'nt find any problem in your code... its happening maybe because of scanf function...

Member Avatar for vinitmittal2008
0
146
Member Avatar for fyezool
Member Avatar for vinitmittal2008

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 …

Member Avatar for vinitmittal2008
0
173
Member Avatar for vinitmittal2008

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++) …

Member Avatar for vinitmittal2008
0
10K
Member Avatar for vinitmittal2008

Please give Free download links of Latest and Best C/C++ Compilers for Windows...

Member Avatar for Ancient Dragon
0
162
Member Avatar for berwick53

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 …

Member Avatar for vinitmittal2008
0
158
Member Avatar for Jollyyy100

[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"); …

Member Avatar for Adak
0
180
Member Avatar for berwick53

[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 …

Member Avatar for Adak
0
199
Member Avatar for vbx_wx

[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]

Member Avatar for vinitmittal2008
0
289
Member Avatar for vinitmittal2008

[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 …

Member Avatar for vinitmittal2008
0
2K
Member Avatar for vinitmittal2008

[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; …

Member Avatar for Ancient Dragon
0
206
Member Avatar for nathanurag

[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 …

Member Avatar for vinitmittal2008
0
173

The End.