Variables
- What will be the output of the following C code?
#include <stdio.h>
void main()
{
{
int R = 81;
}
printf("%d", R);
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
Compilation Error
main.c: In function ‘main’:
main.c:7:22: error: ‘R’ undeclared (first use in this function)
printf("%d", R);
^
main.c:7:22: note: each undeclared identifier is reported only once for each function it appears in
- What will be the output of the following C code?
#include <stdio.h>
static int var = 51;
void main()
{
int var = 91;
{
var = 41;
}
printf("%d", var);
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
41
- What will be the output of the following C code?
#include <stdio.h>
int num;
void main()
{
A();
printf("%d", num);
}
void A()
{
num = 14;
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
14
- What will be the output of the following C code?
#include <stdio.h>
int num = 15;
void main()
{
int num = 13;
A();
printf("%d", num);
}
void A()
{
num = 18;
B();
}
void B()
{
printf("%d ", num);
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
18 13
- What will be the output of the following C code?
#include <stdio.h>
void main()
{
int num = 13;
{
num = 14;
printf("%d", num);
}
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
14