| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| If "AaBbCc" is passed to the char
char x(*a)
{
a[0]?x(a+1):1;
printf("%c",a[0]);
return 1;
}
what will be the output?
| Hughes | 5 |
| what is call by value and call by reference | | 2 |
| write a programe returns the number of times the character
appears in the string | | 1 |
| a C prog to swap 2 no.s without using variables just an
array? | TCS | 4 |
| How to write a code for random pick from 1-1000 numbers?
The output should contain the 10 numbers from the range
1-1000 which should pick randomly, ie ,for each time we run
the code we should get different outputs. | NetApp | 12 |
| what is self refrential structure | HCL | 2 |
| What are Storage Classes in C ? | HP | 14 |
| where does malloc() function get the memory? | | 1 |
| Tell about strtok & strstr functions | Motorola | 2 |
| write a program to print the all 4digits numbers & whose
squares must me even numbers? | Virtusa | 2 |
| main()
{
int i=400,j=300;
printf("%d..%d");
}
| ME | 8 |
| program to find the ASCII value of a number | | 5 |
| wats SIZE_T meant for? | | 1 |
| How to add two numbers without using arithmetic operators? | Sapient | 11 |
| What will be result of the following program?
void myalloc(char *x, int n)
{
x= (char *)malloc(n*sizeof(char));
memset(x,\0,n*sizeof(char));
}
main()
{
char *g="String";
myalloc(g,20);
strcpy(g,"Oldstring");
printf("The string is %s",g);
}
a) The string is : String
b) Run time error/Core dump
c) The string is : Oldstring
d) Syntax error during compilation
e) None of these
| IBM | 3 |
| I have an array of 100 elements, each of which is a random
integer. I want to know which of the elements:
a) are multiples of 2
b) are multiples of 2 AND 5
c) have a remainder of 3 when divided by 7 | | 1 |
| what is dangling pointer? | LG-Soft | 1 |
| how we can make 3d venturing graphics on outer interface | Microsoft | 1 |
| What are the average number of comparisons required to sort
3 elements? | | 2 |
| Can we write a program without main() function? | | 9 |
| |
| For more C Interview Questions Click Here |