Question 1
What will be the output of the following code -
#include<stdio.h>
int main(){
    int main = 999;
    printf("%d",main);
    return 0;
}
A
It will cause run time error
B
999
C
We cannot declare variable name as 'main'
D
None of these
Question 2
Guess the output of the following program -
#include<stdio.h>
int main(){
    int EOF=100;
    printf("%d",EOF);
    return 0;
}
A
Run Time Error
B
Compile Error
C
100
D
0
Question 2 Explanation: 
Variable name cannot be pre defined function of included header file.
Question 3
What will be output of the following c program?
#include<stdio.h>
int main()
{
long break=15;
printf("%ld",break);
return 0;
}
A
51
B
Run Time Error
C
15
D
Compile Error
Question 3 Explanation: 
"break" is reserve word or keyword in C Programming thus it cannot be used as variable name.
Question 4
Guess the output of the following program -
#include<stdio.h>
int main(){
    int NUM = 100;
    printf("%d",num);
    return 0;
}
A
Compile Error
B
100
C
0
D
Run Time Error
Question 4 Explanation: 
Variable name is case sensitive , same word in different cases is considered as different variable.
Question 5
What will be the output of the following code snippet ?
#include<stdio.h>
int main(){
    int scanf=456;
    printf("%d",scanf);
    return 0;
}
A
456
B
Run Time Error
C
45
D
Compile Error
Question 5 Explanation: 
Variable name cannot be pre defined function of included header file

Pages: 1 | 2 | 3 | 4 |