C Programming :: Loop Control - Discussion
Home > C Programming > Loop Control > MCQs Questions Discussion
20 / 61
What is the output of the following 'C' program ?
#include <stdio.h>
int main()
{
int i;
for (i = 0; i < 3; ++i)
{
int t = 1;
static int i = 1;
int *ptr = &i;
printf("%d %d\n",t, *ptr);
t = t + 1;
*ptr = *ptr + 1;
}
return 0;
}
#include <stdio.h>
int main()
{
int i;
for (i = 0; i < 3; ++i)
{
int t = 1;
static int i = 1;
int *ptr = &i;
printf("%d %d\n",t, *ptr);
t = t + 1;
*ptr = *ptr + 1;
}
return 0;
}
A1 0 1 1 1 2
B1 1 1 2 1 3
C1 0 1 0 1 0
DCompilation Error
Answer: Option (Login/Signup)
Show Explanation
Asked In ::
No Discussion on this question yet!