void main()

{

int i=10, j=2;

int *ip= &i, *jp = &j;

int k = *ip/*jp;

printf(“%d”,k);

}



void main() { int i=10, j=2; int *ip= &i, *jp = &j; int ..

Answer / susie

Answer :

Compiler Error: “Unexpected end of file in comment
started in line 5”.

Explanation:

The programmer intended to divide two integers, but by the
“maximum munch” rule, the compiler treats the operator
sequence / and * as /* which happens to be the starting of
comment. To force what is intended by the programmer,

int k = *ip/ *jp;

// give space explicity separating / and *

//or

int k = *ip/(*jp);

// put braces to force the intention

will solve the problem.

Is This Answer Correct ?    9 Yes 0 No

Post New Answer

More C Code Interview Questions

main() { 41printf("%p",main); }8

1 Answers  


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

1 Answers   Amazon, Peak6, Yahoo,


could you please send the program code for multiplying sparse matrix in c????

0 Answers  


main() { char *p="hai friends",*p1; p1=p; while(*p!='\0') ++*p++; printf("%s %s",p,p1); }

3 Answers  


main() { int a=2,*f1,*f2; f1=f2=&a; *f2+=*f2+=a+=2.5; printf("\n%d %d %d",a,*f1,*f2); }

6 Answers  






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

1 Answers   CSC,


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 .

2 Answers  


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

1 Answers   CSC,


main() { static int var = 5; printf("%d ",var--); if(var) main(); }

1 Answers  


main() { char *str1="abcd"; char str2[]="abcd"; printf("%d %d %d",sizeof(str1),sizeof(str2),sizeof("abcd")); }

1 Answers  


Write a C program that defines a 2-dimentional integer array called A [50][50]. Then the elements of this array should randomly be initialized either to 1 or 0. The program should then print out all the elements in the diagonal (i.e. a[0][0], a[1][1],a[2][2], a[3][3], ……..a[49][49]). Finally, print out how many zeros and ones in the diagonal.

2 Answers  


#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  


Categories