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

#define SQR(x) x * x main() { printf("%d", 225/SQR(15)); } a. 1 b. 225 c. 15 d. none of the above

3 Answers   HCL,


how many processes will gate created execution of -------- fork(); fork(); fork(); -------- Please Explain... Thanks in advance..!

8 Answers   GATE,


Write a program that find and print how many odd numbers in a binary tree

1 Answers  


/*what is the output for*/ void main() { int r; printf("Naveen"); r=printf(); getch(); }

4 Answers  


main( ) { int a[ ] = {10,20,30,40,50},j,*p; for(j=0; j<5; j++) { printf(“%d” ,*a); a++; } p = a; for(j=0; j<5; j++) { printf(“%d ” ,*p); p++; } }

1 Answers  






String reverse with time complexity of n/2 with out using temporary variable.

10 Answers   NetApp, Symantec,


main() { char str1[] = {‘s’,’o’,’m’,’e’}; char str2[] = {‘s’,’o’,’m’,’e’,’\0’}; while (strcmp(str1,str2)) printf(“Strings are not equal\n”); }

1 Answers  


#include<stdio.h> main() { char s[]={'a','b','c','\n','c','\0'}; char *p,*str,*str1; p=&s[3]; str=p; str1=s; printf("%d",++*p + ++*str1-32); }

1 Answers  


can u give me the c codings for converting a string into the hexa decimal form......

1 Answers  


What is the hidden bug with the following statement? assert(val++ != 0);

1 Answers  


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

0 Answers   Microsoft,


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

0 Answers  


Categories