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 |
main() { char c; int i = 456; clrscr(); c = i; printf("%d", c); } a. 456 b. -456 c. random number d. none of the above
plz tell me the solution.......... in c language program guess any one number from 1 to 50 and tell that number within 8 asking question in yes or no...............
write a c-program to display the time using FOR loop
main() { struct date; struct student { char name[30]; struct date dob; }stud; struct date { int day,month,year; }; scanf("%s%d%d%d", stud.rollno, &student.dob.day, &student.dob.month, &student.dob.year); }
how many processes will gate created execution of -------- fork(); fork(); fork(); -------- Please Explain... Thanks in advance..!
main() { int i = 3; for (;i++=0;) printf(ā%dā,i); }
Is this code legal? int *ptr; ptr = (int *) 0x400;
main() { char * strA; char * strB = I am OK; memcpy( strA, strB, 6); } a. Runtime error. b. I am OK c. Compile error d. I am O
Cluster head selection in Wireless Sensor Network using C programming language.
What is the output for the program given below typedef enum errorType{warning, error, exception,}error; main() { error g1; g1=1; printf("%d",g1); }
Write a prog to accept a given string in any order and flash error if any of the character is different. For example : If abc is the input then abc, bca, cba, cab bac are acceptable, but aac or bcd are unacceptable.
How we print the table of 3 using for loop in c programing?