main()
{
int i;
printf("%d",scanf("%d",&i)); // value 10 is given as
input here
}
Answers were Sorted based on User's Feedback
Answer / susie
Answer :
1
Explanation:
Scanf returns number of items successfully read and not 1/0.
Here 10 is given as input which should have been scanned
successfully. So number of items read is 1.
| Is This Answer Correct ? | 24 Yes | 1 No |
Write a program to print a square of size 5 by using the character S.
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; } }
Give a oneline C expression to test whether a number is a power of 2?
25 Answers EA Electronic Arts, Google, Motorola,
write a c program to Create a mail account by taking the username, password, confirm password, secret_question, secret_answer and phone number. Allow users to register, login and reset password(based on secret question). Display the user accounts and their details .
main() { 41printf("%p",main); }8
main() { void swap(); int x=10,y=8; swap(&x,&y); printf("x=%d y=%d",x,y); } void swap(int *a, int *b) { *a ^= *b, *b ^= *a, *a ^= *b; }
main() { int i=300; char *ptr = &i; *++ptr=2; printf("%d",i); }
WAP to display 1,2,3,4,5........N
program to Reverse a linked list
12 Answers Aricent, Microsoft, Ness Technologies,
main() { char p[ ]="%d\n"; p[1] = 'c'; printf(p,65); }
main() { int k=1; printf("%d==1 is ""%s",k,k==1?"TRUE":"FALSE"); }
int DIM(int array[]) { return sizeof(array)/sizeof(int ); } main() { int arr[10]; printf(“The dimension of the array is %d”, DIM(arr)); }