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

1. const char *a; 2. char* const a; 3. char const *a; -Differentiate the above declarations.

3 Answers  


I need your help, i need a Turbo C code for this problem.. hope u'll help me guys.? Your program will have a 3x3 array. The user will input the sum of each row and each column. Then the user will input 3 values and store them anywhere, or any location or index, temporarily in the array. Your program will supply the remaining six (6) values and determine the exact location of each value in the array. Example: Input: Sum of row 1: 6 Sum of row 2: 15 Sum of row 3: 24 Sum of column 1: 12 Sum of column 2: 15 Sum of column 3: 18 Value 1: 3 Value 2: 5 Value 3: 6 Output: Sum of Row 1 2 3 6 4 5 6 15 7 8 9 24 Sum of Column 12 15 18 Note: Your program will not necessary sort the walues in the array Thanks..

0 Answers  


main() { int c = 5; printf("%d", main||c); } a. 1 b. 5 c. 0 d. none of the above

2 Answers   HCL,


Write a routine to implement the polymarker function

0 Answers   TCS,


Write a prog to accept a given string in any order and flash error if any of the character is different. For example : If abc is the input then abc, bca, cba, cab bac are acceptable, but aac or bcd are unacceptable.

5 Answers   Amazon, Microsoft,






main() { int (*functable[2])(char *format, ...) ={printf, scanf}; int i = 100; (*functable[0])("%d", i); (*functable[1])("%d", i); (*functable[1])("%d", i); (*functable[0])("%d", &i); } a. 100, Runtime error. b. 100, Random number, Random number, Random number. c. Compile error d. 100, Random number

1 Answers   HCL, rsystems,


#define f(g,g2) g##g2 main() { int var12=100; printf("%d",f(var,12)); }

3 Answers  


how to programme using switch statements and fuctions, a programme that will output two even numbers, two odd numbers and two prime numbers of the users chioce.

0 Answers   Mbarara University of Science and Technology,


Code for 1>"ascii to string" 2>"string to ascii"

1 Answers   Aricent, Global Logic,


writte a c-programm to display smill paces

2 Answers  


main(int argc, char *argv[]) { (main && argc) ? main(argc-1, NULL) : return 0; } a. Runtime error. b. Compile error. Illegal syntax c. Gets into Infinite loop d. None of the above

4 Answers   HCL, LG,


Is the following code legal? struct a { int x; struct a b; }

1 Answers  


Categories