MCQs
There is an error in the line emp int xx;
To overcome this error, remove the int and add the struct at the begining of emp int xx;
#include<stdio.h>
struct emp
{
char name[20];
int age;
};
int main()
{
struct emp xx;
int a;
printf("%d\n", &a);
return 0;
}
No answer description available for this question
In case of a conflict between a local variable and global variable,
the local variable gets priority.
During the for loop execution scanf() ask input and then printf() prints that given input.
This process will be continued repeatedly because, scanf() returns the number of input
given, the condition is always true(user gives a input means it reurns '1').
Hence this for loop would get executed infinite times
In this program the compiler will not know that the function display() exists.
So, the compiler will generate "Type mismatch in redeclaration of function
display()".
To over come this error, we have to add function prototype of function display().
Another way to overcome this error is to define the function display() before the
int main(); function.
#include<stdio.h>
void display(); /* function prototype */
int main()
{
display();
return 0;
}
void display()
{
printf("Placementadda.com");
}
When an automatic array is partially initialized, the remaining elements are initialized to 0.
2 Errors
1. Type mismatch in redeclaration of fun
2. Type mismatch in parameter aa
Since x < y turns to be TRUE it is replaced by 1. Then 1 < z is compared and to be TRUE.
The 1 is assigned to i.
Whenever there is conflict between a local variable and global variable, the local
variable gets priority.