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 |
How do you sort a Linked List (singly connected) in O(n) please mail to pawan.10k@gmail.com if u can find an anser...i m desperate to knw...
6 Answers Microsoft, MSD, Oracle,
Write a program that reads a dynamic array of 40 integers and displays only even integers
main() { register int a=2; printf("Address of a = %d",&a); printf("Value of a = %d",a); }
main() { extern out; printf("%d", out); } int out=100;
int i; main(){ int t; for ( t=4;scanf("%d",&i)-t;printf("%d\n",i)) printf("%d--",t--); } // If the inputs are 0,1,2,3 find the o/p
print numbers till we want without using loops or condition statements like specifically(for,do while, while swiches, if etc)!
create a C-code that will display the total fare of a passenger of a taxi if the driver press enter,the timer will stop. Every 10 counts is 2 pesos. Initial value is 25.00
What is data _null_? ,Explain with code when u need to use it in data step programming ?
union u { union u { int i; int j; }a[10]; int b[10]; }u; main() { printf("\n%d", sizeof(u)); printf(" %d", sizeof(u.a)); // printf("%d", sizeof(u.a[4].i)); } a. 4, 4, 4 b. 40, 4, 4 c. 1, 100, 1 d. 40 400 4
main() { int c[ ]={2.8,3.4,4,6.7,5}; int j,*p=c,*q=c; for(j=0;j<5;j++) { printf(" %d ",*c); ++q; } for(j=0;j<5;j++){ printf(" %d ",*p); ++p; } }
main() { int i; float *pf; pf = (float *)&i; *pf = 100.00; printf("\n %d", i); } a. Runtime error. b. 100 c. Some Integer not 100 d. None of the above
How to use power function under linux environment.eg : for(i=1;i<=n;i++){ pow(-1,i-1)} since it alerts undefined reference to 'pow'.