void main()

{

char a[]="12345\0";

int i=strlen(a);

printf("here in 3 %d\n",++i);

}

Answers were Sorted based on User's Feedback



void main() { char a[]="12345\0"; int i=strlen(a); printf("here in 3 %..

Answer / susie

Answer :

here in 3 6

Explanation:

The char array 'a' will hold the initialized string, whose
length will be counted from 0 till the null character. Hence
the 'I' will hold the value equal to 5, after the
pre-increment in the printf statement, the 6 will be printed.

Is This Answer Correct ?    18 Yes 4 No

void main() { char a[]="12345\0"; int i=strlen(a); printf("here in 3 %..

Answer / lucky varshney

here in 3
7

Is This Answer Correct ?    4 Yes 6 No

void main() { char a[]="12345\0"; int i=strlen(a); printf("here in 3 %..

Answer / ravneet kaur

as this is a character array and would have string in double
quotes so this code shows an error i.e. *char wont changes
to *int.

Is This Answer Correct ?    0 Yes 5 No

Post New Answer

More C Code Interview Questions

what will be the position of the file marker? a: fseek(ptr,0,SEEK_SET); b: fseek(ptr,0,SEEK_CUR);

2 Answers  


void main () { int x = 10; printf ("x = %d, y = %d", x,--x++); } a. 10, 10 b. 10, 9 c. 10, 11 d. none of the above

2 Answers   HCL,


why array index always strats wuth zero?

2 Answers  


main() { int i=0; for(;i++;printf("%d",i)) ; printf("%d",i); }

1 Answers   Zoho,


abcdedcba abc cba ab ba a a

2 Answers  






Design an implement of the inputs functions for event mode

0 Answers   Wipro,


void main() { int c; c=printf("Hello world"); printf("\n%d",c); }

2 Answers  


why java is platform independent?

13 Answers   Wipro,


What are the files which are automatically opened when a C file is executed?

1 Answers  


Give a oneline C expression to test whether a number is a power of 2?

25 Answers   EA Electronic Arts, Google, Motorola,


main() { int i=-1; +i; printf("i = %d, +i = %d \n",i,+i); }

1 Answers  


main() { float me = 1.1; double you = 1.1; if(me==you) printf("I love U"); else printf("I hate U"); }

1 Answers  


Categories