| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| a=0;
while(a<5)
printf("%d\n",a++);
how many times does the loop occurs?
a.infinite
b.5
c.4
d.6
| TCS | 5 |
| n=7623
{
temp=n/10;
result=temp*10+ result;
n=n/10
}
| Wipro | 4 |
| void main()
{
char far *farther,*farthest;
printf("%d..%d",sizeof(farther),sizeof(farthest));
}
| ME | 3 |
| What are volatile variables? | | 1 |
| What's wrong with "char *p; *p = malloc(10);"? | | 5 |
| What is alloca() and why is its use discouraged? | | 1 |
| Which is not valid in C?
1) class aClass{public:int x;}
2) /* A comment */
3) char x=12;
| | 5 |
| 4.A function 'q' that accepts a pointer to a character as
argument and returns a pointer to an array of integer can
be declared as:
A)int (*q(char*)) []
B)int *q(char*) []
C)int(*q)(char*) []
D)None of the Above
| Accenture | 4 |
| How do you write a program which produces its own source
code as its output? | | 2 |
| wap in c to accept a number display the total count of digit | | 4 |
| what is op?
for(c=0;c=1000;c++)
printf("%c",c); | Trigent | 18 |
| what is the output of below pgm?
void main()
{
int i=0;
if(i)
printf("pass");
else
printf("fail");
} | | 3 |
| How can I call a function, given its name as a string? | ABC-Telecom | 2 |
| wite a programme in c to linear search a data using flag and
without using flags? | TCS | 3 |
| Which of the following is not an infinite loop ?
a.while(1){
....
}
b.for(;;){
...
}
c.x=0;
do{
/*x unaltered within theloop*/
...
}while(x==0);
d.# define TRUE 0
...
while(TRUE){
....
}
| TCS | 4 |
| 11. Look at the Code:
#include<string.h>
void main()
{
char s1[]="abcd";
char s2[10];
char s3[]="efgh";
int i;
clrscr();
i=strcmp(strcat(s3,ctrcpy(s2,s1))strcat(s3,"abcd"));
printf("%d",i);
}
What will be the output?
A)No output B) A Non Integer C)0 D) Garbage
| Accenture | 7 |
| 34.what are bitwise shift operators?
35.what are bit fields? What is the use of bit fields in a
structure declaration?
36.what is the size of an integer variable?
37.what are the files which are automatically opened when a
c file is executed?
38.what is the little endian and big endian?
39.what is the use of fflush() function?
40.what is the difference between exit() and _exit() functions?
41.where does malloc() function get the memory?
42.what is the difference between malloc() and calloc()
function?
43.what is the difference between postfix and prefix unary
increment operators? | | 2 |
| WAP to convert text into its ASCII Code and also write a
function to decode the text given? | | 2 |
| what is the difference between c and java? | | 1 |
| write the program for maximum of the following numbers?
122,198,290,71,143,325,98 | | 4 |
| |
| For more C Interview Questions Click Here |