C Interview: Date: - Name
C Interview: Date: - Name
Date : ________________
Name : ___________________________________________________________________________
int main()
short i;
printf("%d\n", i);
Numbers will be displayed until the signed limit of short and throw a runtime error
Numbers will be displayed until the signed limit of short and program will successfully
terminate
This program will get into an infinite loop and keep printing numbers with no errors
1
2. What will be the output of following code?
#include <stdio.h>
void main()
int x = 0;
if (x == 0)
printf("Hi");
else
printf("Hello");
Hi
Hello
HiHello
!=
==
||
2
Whole source file in which it is defined
From the point of declaration to the end of the file in which it is defined
From the point where it is declared to the end of the file being compiled
%, *, /, +, –
%, +, /, *, –
+, -, %, *, /
%, +, -, *, /
int
float
double
No types
printf(“%p”, main);
3
Error
Infinite loop
None of above
Required inputdata
None of above
Interpreter
Compiler
Above both
4
10. What will be the output of the following program?
main(
int i = abc(10);
printf(“%d”,i);
return(i++);
10
11
5
Answer
1 C
2 D
3 D
4 D
5 A
6 A
7 C
8 A
9 B
10 B