TCS Technical Questions With Solutions 3

11.
How many times loop will executed ?

#include<stdio.h>
int main()
{
int x,y;
for(x=5;x>=1;x–)
{
for(y=1;y<=x;y++)
printf(“%d\n”,y);
}
}

a) 11
b) 13
c) 15
d) 10

12.
Which of the following indicate the end of file ?

a) feof()
b) EOF
c) Both feof() and EOF
d) None of the mentioned

13.
If a functions return type is not explicitly defined then it is default to ……….(in C).

a) int
b) float
c) void
d) error

14.
Where the local variable is stored ?

a) Disk
b) Stack
c) Heap
d) Register

15.
How many times loop will executed ?

#include<stdio.h>
int main()
{
int i;
for(i=0;i<5;i++)
{
printf(“Hello\n”);
}
}

a) 0
b) 1
c) 3
d) 5

Visitor Counter

0056757