What will be the output of the following C code?
#include < stdio.h >
void main()
{
int i = 0, k;
if (i == 0)
goto label;
for (k = 0;k < 3; k++)
{
printf(“hi\n”);
label: k = printf(“%03d”, i);
}
}
a) 0
b) hi hi hi 0 0 0
c) 0 hi hi hi 0 0 0
d) 0 0 0
Answer: d
Related Posts
What will be the output of the following C code?
#include < stdio.h >
static int x = 5;
void main()
{
int x = 9;
{
x = 4;
}
printf(“%d”, x);
}What will be the output of the following C code?
#include < stdio.h >
int x;
void main()
{
m();
printf(“%d”, x);
}
void m()
{
x = 4;
}What will be the output of the following C code?
#include < stdio.h >
int x = 5;
void main()
{
int x = 3;
m();
printf(“%d”, x);
}
void m()
{
x = 8;
n();
}
void n()
{
printf(“%d”, x);
}What will be the output of the following C code?
#include < stdio.h >
void main()
{
int x = 3;
{
x = 4;
printf(“%d”, x);
}
}Array sizes are optional during array declaration by using ______ keyword.
What will be the sequence of allocation and deletion of variables in the following C code?
#include < stdio.h >
int main()
{
int a;
{
int b;
}
}Comment on the following 2 C programs.
#include < stdio.h > //Program 1
int main()
{
int a;
int b;
int c;
}
#include < stdio.h > //Program 2
int main()
{
int a;
{
int b;
}
{
int c;
}
}
Join The Discussion