| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| 1)which of following operator can't be overloaded.
a)== b)++ c)?! d)<= | Siemens | 10 |
| Difference between Class and Struct.
| Motorola | 6 |
| pointer_variable=(typecasting
datatype*)malloc(sizeof(datatype));
This is the syntax for malloc?Please explain this,how it
work with an example? | Excel | 2 |
| what is the output of below pgm?
void main()
{
int i=0;
if(i)
printf("pass");
else
printf("fail");
} | | 3 |
| What is structure packing ? | HP | 1 |
| how to do in place reversal of a linked list(singly or
doubly)? | | 2 |
| Write a C program that reads a series of strings and prints
only those ending in "ed" | | 2 |
| 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 |
| program to find which character is occured more times in a
string and how many times it has occured? for example in
the sentence "i love india" the output should be i & 3. | | 3 |
| What will be the result of the following program?
main()
{
char p[]="String";
int x=0;
if(p=="String")
{
printf("Pass 1");
if(p[sizeof(p)-2]=='g')
printf("Pass 2");
else
printf("Fail 2");
}
else
{
printf("Fail 1");
if(p[sizeof(p)-2]=='g')
printf("Pass 2");
else
printf("Fail 2");
}
}
a) Pass 1, Pass 2
b) Fail 1, Fail 2
c) Pass 1, Fail 2
d) Fail 1, Pass 2
e) syntax error during compilation
| IBM | 10 |
| for example user gives input as " 20 or 20.0 or rs 20.0 or
20.00 or rs20 and so .. on " and the output should be
stored as " rs.20.00 " in a variable | | 2 |
| explain about storage of union elements. | Bosch | 2 |
| How many types of linked lists what are they?
How many types of data structures? | BSNL | 5 |
| wap in c to accept a number display the total count of digit | | 4 |
| what is the output of the following code?
main()
{
int I;
I=0x10+010+10;
printf("x=%x",I);
}
give detailed reason | | 3 |
| 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 | 5 |
| Difference Between embedded software and soft ware? | Bosch | 1 |
| i=20,k=0;
for(j=1;j<i;j=1+4*(i/j))
{
k+=j<10?4:3;
}
printf("%d", k);
| HCL | 6 |
| please give me answer with details
#include<stdio.h>
main()
{
int i=1;
i=(++i)*(++i)*(++i);
printf("%d",i);
getch();
} | | 3 |
| wats SIZE_T meant for? | | 1 |
| |
| For more C Interview Questions Click Here |