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 |
How do I write a program to print proper subset of given string . Eg :input: abc output:{},{a},{b},{c},{a,b},{a,c},{b,c}, {a,b,c}.I desperately need this program please mail me to saravana6m@gmail.com
int main() { int x=10; printf("x=%d, count of earlier print=%d", x,printf("x=%d, y=%d",x,--x)); getch(); } ================================================== returns error>> ld returned 1 exit status =================================================== Does it have something to do with printf() inside another printf().
main() { { unsigned int bit=256; printf("%d", bit); } { unsigned int bit=512; printf("%d", bit); } } a. 256, 256 b. 512, 512 c. 256, 512 d. Compile error
char *someFun1() { char temp[ ] = “string"; return temp; } char *someFun2() { char temp[ ] = {‘s’, ‘t’,’r’,’i’,’n’,’g’}; return temp; } int main() { puts(someFun1()); puts(someFun2()); }
main() { int y; scanf("%d",&y); // input given is 2000 if( (y%4==0 && y%100 != 0) || y%100 == 0 ) printf("%d is a leap year"); else printf("%d is not a leap year"); }
find A^B using Recursive function
What is your nationality?
Is it possible to type a name in command line without ant quotes?
Is this code legal? int *ptr; ptr = (int *) 0x400;
Is there any difference between the two declarations, 1. int foo(int *arr[]) and 2. int foo(int *arr[2])
How do you verify if the two sentences/phrases input is an anagram using predefined functions in string.h and by using arrays?
How do you write a program which produces its own source code as its output?