Which version do you prefer of the following two,
1) printf(“%s”,str); // or the more curt one
2) printf(str);
Answer / susie
Answer : & Explanation:
Prefer the first one. If the str contains any format
characters like %d then it will result in a subtle bug.
| Is This Answer Correct ? | 3 Yes | 0 No |
main() { signed int bit=512, mBit; { mBit = ~bit; bit = bit & ~bit ; printf("%d %d", bit, mBit); } } a. 0, 0 b. 0, 513 c. 512, 0 d. 0, -513
3 Answers HCL, Logical Computers,
#include<stdio.h> main() { int i=1,j=2; switch(i) { case 1: printf("GOOD"); break; case j: printf("BAD"); break; } }
C program to print magic square of order n where n > 3 and n is odd
Find your day from your DOB?
15 Answers Accenture, Microsoft,
main() { char a[4]="HELLO"; printf("%s",a); }
main() { int i, j, *p; i = 25; j = 100; p = &i; // Address of i is assigned to pointer p printf("%f", i/(*p) ); // i is divided by pointer p } a. Runtime error. b. 1.00000 c. Compile error d. 0.00000
main() { int i = 257; int *iPtr = &i; printf("%d %d", *((char*)iPtr), *((char*)iPtr+1) ); }
void ( * abc( int, void ( *def) () ) ) ();
void main() { static int i; while(i<=10) (i>2)?i++:i--; printf(“%d”, i); }
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...............
What is data _null_? ,Explain with code when u need to use it in data step programming ?
main() { int i=0; while(+(+i--)!=0) i-=i++; printf("%d",i); }
9 Answers CSC, GoDB Tech, IBM,