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 |
#include<stdio.h> main() { register i=5; char j[]= "hello"; printf("%s %d",j,i); }
main() { int a[10]; printf("%d",*a+1-*a+3); }
what is the output of following program ? void main() { int i=5; printf("%d %d %d %d %d ",i++,i--,++i,--i,i); }
main() { int i; printf("%d",scanf("%d",&i)); // value 10 is given as input here }
Is the following code legal? typedef struct a aType; struct a { int x; aType *b; };
main() { signed int bit=512, i=5; for(;i;i--) { printf("%d\n", bit = (bit >> (i - (i -1)))); } } a. 512, 256, 128, 64, 32 b. 256, 128, 64, 32, 16 c. 128, 64, 32, 16, 8 d. 64, 32, 16, 8, 4
How can you relate the function with the structure? Explain with an appropriate example.
main() { char string[]="Hello World"; display(string); } void display(char *string) { printf("%s",string); }
writte a c-programm to display smill paces
to remove the repeated cahracter from the given caracter array. i.e.., if the input is SSAD output should of SAD
How do you create a really large matrix (i.e. 3500x3500) in C without having the program crash? I can only reach up to 2500. It must have something to do with lack of memory. Please help!
Write a single line c expression to delete a,b,c from aabbcc