char inputString[100] = {0};
To get string input from the keyboard which one of the
following is better?
1) gets(inputString)
2) fgets(inputString, sizeof(inputString), fp)
Answer / susie
Answer : & Explanation:
The second one is better because gets(inputString) doesn't
know the size of the string passed and so, if a very big
input (here, more than 100 chars) the charactes will be
written past the input string. When fgets is used with stdin
performs the same operation as gets but is safe.
| Is This Answer Correct ? | 2 Yes | 0 No |
Find your day from your DOB?
15 Answers Accenture, Microsoft,
Write a procedure to implement highlight as a blinking operation
main() { int i =10, j = 20; clrscr(); printf("%d, %d, ", j-- , --i); printf("%d, %d ", j++ , ++i); } a. 20, 10, 20, 10 b. 20, 9, 20, 10 c. 20, 9, 19, 10 d. 19, 9, 20, 10
Is the following statement a declaration/definition. Find what does it mean? int (*x)[10];
void main() { char far *farther,*farthest; printf("%d..%d",sizeof(farther),sizeof(farthest)); }
How do you verify if the two sentences/phrases input is an anagram using predefined functions in string.h and by using arrays?
Is the following code legal? struct a { int x; struct a *b; }
void main() { char ch; for(ch=0;ch<=127;ch++) printf(“%c %d \n“, ch, ch); }
int aaa() {printf(“Hi”);} int bbb(){printf(“hello”);} iny ccc(){printf(“bye”);} main() { int ( * ptr[3]) (); ptr[0] = aaa; ptr[1] = bbb; ptr[2] =ccc; ptr[2](); }
can u give me the c codings for converting a string into the hexa decimal form......
Is the following code legal? typedef struct a aType; struct a { int x; aType *b; };
main() { float me = 1.1; double you = 1.1; if(me==you) printf("I love U"); else printf("I hate U"); }