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() { while (strcmp(“some”,”some\0”)) printf(“Strings are not equal\n”); }
abcdedcba abc cba ab ba a a
void main() { int k=ret(sizeof(float)); printf("\n here value is %d",++k); } int ret(int ret) { ret += 2.5; return(ret); }
Write a program that find and print how many odd numbers in a binary tree
main() { int i=5; printf("%d",++i++); }
Ramesh’s basic salary is input through the keyboard. His dearness allowance is 40% of basic salary, and house rent allowance is 20% of basic salary. Write a program to calculate his gross salary.
Predict the Output: int main() { int *p=(int *)2000; scanf("%d",2000); printf("%d",*p); return 0; } if input is 20 ,what will be print
posted by surbhi just now main() { float a = 5.375; char *p; int i; p=(char*)&a; for(i=0;i<=3;i++) printf("%02x",(unsigned char) p[i]); } how is the output of this program is :: 0000ac40 please let me know y this output has come
How to reverse a String without using C functions ?
33 Answers Matrix, TCS, Wipro,
Program to find the largest sum of contiguous integers in the array. O(n)
main() { int i=-1; +i; printf("i = %d, +i = %d \n",i,+i); }
Which version do you prefer of the following two, 1) printf(“%s”,str); // or the more curt one 2) printf(str);