void main()
{
int i=10, j=2;
int *ip= &i, *jp = &j;
int k = *ip/*jp;
printf(“%d”,k);
}
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 |
main() { char p[ ]="%d\n"; p[1] = 'c'; printf(p,65); }
program to find magic aquare using array
int i,j; for(i=0;i<=10;i++) { j+=5; assert(i<5); }
How can you relate the function with the structure? Explain with an appropriate example.
Derive expression for converting RGB color parameters to HSV values
writte a c-programm to display smill paces
Is the following code legal? typedef struct a { int x; aType *b; }aType
main() { int k=1; printf("%d==1 is ""%s",k,k==1?"TRUE":"FALSE"); }
#include<stdio.h> main() { struct xx { int x=3; char name[]="hello"; }; struct xx *s; printf("%d",s->x); printf("%s",s->name); }
write a c program to Reverse a given string using string function and also without string function
void main() { int i; char a[]="\0"; if(printf("%s\n",a)) printf("Ok here \n"); else printf("Forget it\n"); }
main() { extern int i; i=20; printf("%d",i); }