1. 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
2. Which of the following indicate the end of file ?
a) feof()
b) EOF
c) Both feof() and EOF
d) None of the mentioned
3. If a functions return type is not explicitly defined then it is default to ..........(in C).
a) int
b) float
c) void
d) error
4. Where the local variable is stored ?
a) Disk
b) Stack
c) Heap
d) Register
5. 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
6. What is dangling pointer?
a) points to garbage value
b) points to function
c) Both A and B
d) None of these
7. what is the purpose of ftell ?
a)to get the current file position
b)to get the current file attribute
c)to get the current file status
d)to get the current file name
8. What is recursion ?
a) looping
b) a function calls another function repeatedly
c) a fnction calls repeatedly
d) function calls itself repeatedly
9. What is the similarity between enum and struct ?
a) can assign new values
b) can create new data types
c) nothing in common
d) they are same
10. which of the following is not a fundamental datatype?
a) Enum
b) unsigned long int
c) Long int
d) double
11. How many times hello will print ?
#include<stdio.h>
int main(void)
{
int i;
for(i=0;i<5;i++);
printf("hello");
}
a) Compilation error
b) Runtime error
c) 4
d) 1
#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
2. Which of the following indicate the end of file ?
a) feof()
b) EOF
c) Both feof() and EOF
d) None of the mentioned
3. If a functions return type is not explicitly defined then it is default to ..........(in C).
a) int
b) float
c) void
d) error
4. Where the local variable is stored ?
a) Disk
b) Stack
c) Heap
d) Register
5. 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
6. What is dangling pointer?
a) points to garbage value
b) points to function
c) Both A and B
d) None of these
7. what is the purpose of ftell ?
a)to get the current file position
b)to get the current file attribute
c)to get the current file status
d)to get the current file name
8. What is recursion ?
a) looping
b) a function calls another function repeatedly
c) a fnction calls repeatedly
d) function calls itself repeatedly
9. What is the similarity between enum and struct ?
a) can assign new values
b) can create new data types
c) nothing in common
d) they are same
10. which of the following is not a fundamental datatype?
a) Enum
b) unsigned long int
c) Long int
d) double
11. How many times hello will print ?
#include<stdio.h>
int main(void)
{
int i;
for(i=0;i<5;i++);
printf("hello");
}
a) Compilation error
b) Runtime error
c) 4
d) 1
13 Comments
very useful questions please upload more questions
ReplyDeleteI am working on this blog and will upload more questions soon
DeleteCan anyone explain the last question?
ReplyDeleteIn the last question there is a semicolon after for loop, so printf will work only once.
Delete@Harishabh
DeleteDon't u think same goes for Q5.??
No , there is no termination of for loop i.e no semicolon at the end of for statement so control enters into loop and executes 5 times and prints it 5 times.
Delete@unknown
Deleteyes, u r right. I just misread the question. Thank u anyway
can u plz provide more aptitude, technical and coding question asked in TCS?
ReplyDeleteHow much time takes to declare TCS aptitude result
ReplyDeletePreviosly It was declaring its result within one or two days but from few past experiences, I think it can take upto a week or in some cases around 10 days.
DeletePlz upload more questions
ReplyDeleteis there any chance the same like questions asked in drive?
ReplyDeleteAny thing can happen. It might repeat but no sure. Keep yourself prepared.
Delete