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
None of these
C
We cannot declare variable name as 'main'
D
999
Question 2
What will be the output of the following code snippet ?
#include<stdio.h>
int main(){
    int scanf=456;
    printf("%d",scanf);
    return 0;
}
A
Run Time Error
B
Compile Error
C
456
D
45
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
15
C
Compile Error
D
Run Time 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 EOF=100;
    printf("%d",EOF);
    return 0;
}
A
Compile Error
B
100
C
Run Time Error
D
0
Question 4 Explanation: 
Variable name cannot be pre defined function of included header file.
Question 5
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 5 Explanation: 
Variable name is case sensitive , same word in different cases is considered as different variable.

Pages: 1 | 2 | 3 | 4 |