main()
{
show();
}
void show()
{
printf("I'm the greatest");
}
Answers were Sorted based on User's Feedback
Answer / susie
Answer :
Compier error: Type mismatch in redeclaration of show.
Explanation:
When the compiler sees the function show it doesn't know
anything about it. So the default return type (ie, int) is
assumed. But when compiler sees the actual definition of
show mismatch occurs since it is declared as void. Hence the
error.
The solutions are as follows:
1. declare void show() in main() .
2. define show() before main().
3. declare extern void show() before the use of show().
Is This Answer Correct ? | 7 Yes | 0 No |
main() { int i=3; switch(i) { default:printf("zero"); case 1: printf("one"); break; case 2:printf("two"); break; case 3: printf("three"); break; } }
Give a oneline C expression to test whether a number is a power of 2?
25 Answers EA Electronic Arts, Google, Motorola,
main() { int i = 257; int *iPtr = &i; printf("%d %d", *((char*)iPtr), *((char*)iPtr+1) ); }
Write a C program to print look and say sequence? For example if u get the input as 1 then the sequence is 11 21 1211 111221 312211 12112221 .......(it counts the no. of 1s,2s etc which is in successive order) and this sequence is used in run-length encoding.
write a program in c language to get the value of arroy keys pressed and display the message which arrow key is pressed?
What is your nationality?
hello sir,is there any function in C that can calculate number of digits in an int type variable,suppose:int a=123; 3 digits in a.what ll b answer?
main() { printf("%x",-1<<4); }
union u { union u { int i; int j; }a[10]; int b[10]; }u; main() { printf("\n%d", sizeof(u)); printf(" %d", sizeof(u.a)); // printf("%d", sizeof(u.a[4].i)); } a. 4, 4, 4 b. 40, 4, 4 c. 1, 100, 1 d. 40 400 4
Write a function to find the depth of a binary tree.
13 Answers Adobe, Amazon, EFI, Imagination Technologies,
Cluster head selection in Wireless Sensor Network using C programming language.
Is the following code legal? typedef struct a aType; struct a { int x; aType *b; };