main()
{
char string[]="Hello World";
display(string);
}
void display(char *string)
{
printf("%s",string);
}
Answers were Sorted based on User's Feedback
Answer / susie
Answer :
Compiler Error : Type mismatch in redeclaration of
function display
Explanation :
In third line, when the function display is
encountered, the compiler doesn't know anything about the
function display. It assumes the arguments and return types
to be integers, (which is the default type). When it sees
the actual function display, the arguments and type
contradicts with what it has assumed previously. Hence a
compile time error occurs.
Is This Answer Correct ? | 21 Yes | 3 No |
Answer / pratibha
this problem of type mismatching can be solved by declaring display function as a first line inside main() so that compiler will know that display is of type void and then it will resolve type mismatch while encountering calling function of display.
Is This Answer Correct ? | 0 Yes | 0 No |
write a c program to Reverse a given string using string function and also without string function
what is variable length argument list?
main() { char str1[] = {‘s’,’o’,’m’,’e’}; char str2[] = {‘s’,’o’,’m’,’e’,’\0’}; while (strcmp(str1,str2)) printf(“Strings are not equal\n”); }
What are the files which are automatically opened when a C file is executed?
There are 21 people in a room. They have to form groups of 3 people each. How many combinations are possible? Write a C program to print the same.
What is the main difference between STRUCTURE and UNION?
how to delete an element in an array
Write a routine that prints out a 2-D array in spiral order
main() { int i =10, j = 20; clrscr(); printf("%d, %d, ", j-- , --i); printf("%d, %d ", j++ , ++i); } a. 20, 10, 20, 10 b. 20, 9, 20, 10 c. 20, 9, 19, 10 d. 19, 9, 20, 10
How will you print % character? a. printf(“\%”) b. printf(“\\%”) c. printf(“%%”) d. printf(“\%%”)
how to programme using switch statements and fuctions, a programme that will output two even numbers, two odd numbers and two prime numbers of the users chioce.
0 Answers Mbarara University of Science and Technology,
4. Main() { Int i=3,j=2,c=0,m; m=i&&j||c&I; printf(“%d%d%d%d”,I,j,c,m); }