void main()

{

int i;

char a[]="\0";

if(printf("%s\n",a))

printf("Ok here \n");

else

printf("Forget it\n");

}

Answers were Sorted based on User's Feedback



void main() { int i; char a[]="\0"; if(printf("%s\n",a)) pri..

Answer / susie

Answer :

Ok here

Explanation:

Printf will return how many characters does it print. Hence
printing a null character returns 1 which makes the if
statement true, thus "Ok here" is printed.

Is This Answer Correct ?    14 Yes 4 No

void main() { int i; char a[]="\0"; if(printf("%s\n",a)) pri..

Answer / rahul bagale

Ans :Forget it

Explation:

'' is a char with value 0 in C++ and an int with the value 0 in C.

Is This Answer Correct ?    1 Yes 3 No

void main() { int i; char a[]="\0"; if(printf("%s\n",a)) pri..

Answer / sunder.r

answewr: forget it

Is This Answer Correct ?    1 Yes 4 No

Post New Answer

More C Code Interview Questions

Implement a t9 mobile dictionary. (Give code with explanation )

1 Answers   Amazon, Peak6, Yahoo,


what is brs test reply me email me kashifabbas514@gmail.com

0 Answers  


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 c program to search an element in an array using recursion

1 Answers   Wipro,


main() { char a[4]="HELL"; printf("%s",a); }

3 Answers   Wipro,






Write a single line c expression to delete a,b,c from aabbcc

2 Answers   Microsoft,


#include<stdio.h> #include<conio.h> void main() { int a=(1,2,3,(1,2,3,4); switch(a) { printf("ans:"); case 1: printf("1");break; case 2: printf("2");break; case 3: printf("1");break; case 4: printf("4");break; printf("end"); } getch(); }

0 Answers  


void main() { char a[]="12345\0"; int i=strlen(a); printf("here in 3 %d\n",++i); }

3 Answers  


main() { int i=3; switch(i) { default:printf("zero"); case 1: printf("one"); break; case 2:printf("two"); break; case 3: printf("three"); break; } }

1 Answers  


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; } }

1 Answers  


main() { int i = 258; int *iPtr = &i; printf("%d %d", *((char*)iPtr), *((char*)iPtr+1) ); }

1 Answers  


what is oop?

3 Answers  


Categories