| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| What's the difference between struct x1 { ... }; and
typedef struct { ... } x2; ?
| | 3 |
| main()
{
char *p;
p="Hello";
printf("%c\n",*&*p);
}
| ME | 2 |
| write a function for strtok()?? | Verifone | 1 |
| What kind of sorting is this?
SORT (k,n)
1.[Loop on I Index]
repeat thru step2 for i=1,2,........n-1
2.[For each pass,get small value]
min=i;
repeat for j=i+1 to N do
{
if K[j]<k[min]
min=j;
}
temp=K[i];K[i]=K[min];K[min]=temp;
3.[Sorted Values will be returned]
A)Bubble Sort
B)Quick Sort
C)Selection Sort
D)Merge Sort | Accenture | 3 |
| Can we write a program without main() function? | | 9 |
| main()
{
int arr[5]={23,67};
printf("%d%d%d",arr[2],arr[3],arr[4]);
} | TCS | 6 |
| What is an anonymous union and where to apply that ? | HP | 3 |
| what is available in C language but not in C++? | | 1 |
| if a person is buying coconuts of Rs10,and then sell that
coconuts of Rs9,with the loss of one rupee.After that the
person became a millaniore.how? | Wipro | 5 |
| How to access or modify the const variable in c ? | HP | 4 |
| int a=1,b=2,c=3;
printf("%d,%d",a,b,c);
What is the output?
| Verifone | 14 |
| Write one statement equalent to the following two statements
x=sqr(a);
return(x);
Choose from one of the alternatives
a.return(sqr(a));
b.printf("sqr(a)");
c.return(a*a*a);
d.printf("%d",sqr(a));
| TCS | 4 |
| can we access one file to one directory? | | 1 |
| How many types of linked lists what are they?
How many types of data structures? | BSNL | 5 |
| How would you print out the data in a binary tree, level by
level, starting at the top? | Microsoft | 4 |
| Look at the Code:
main()
{
int a[]={1,2,3},i;
for(i=0;i<3;i++)
{
printf("%d",*a);
a++;
}
}
Which Statement is/are True w.r.t the above code?
I.Executes Successfully & Prints the contents of the array
II.Gives the Error:Lvalue Required
III.The address of the array should not be changed
IV.None of the Above.
A)Only I B)Only II C)II & III D)IV
| Accenture | 3 |
| Reverse a string word by word?? | | 6 |
| Reverse the part of the number which is present from
position i to j. Print the new number.[without using the array]
eg:
num=789876
i=2
j=5
778986 | | 2 |
| What is external and internal variables
What is dynamic memory allocation
what is storage classes in C | | 2 |
| main()
{
char *p1="Name";
char *p2;
p2=(char *)malloc(20);
while(*p2++=*p1++);
printf("%s\n",p2);
}
what is the output?
| Ramco | 4 |
| |
| For more C Interview Questions Click Here |