| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| fn f(x)
{ if(x<=0)
return;
else f(x-1)+x;
}
| HCL | 3 |
| Who is invented by c? | Infosys | 14 |
| What is the output of the following program
#include<stdio.h>
main()
{
int i=0;
fork();
printf("%d",i++);
fork();
printf("%d",i++);
fork();
wait();
} | ADITI | 5 |
| Can I pass constant values to functions which accept structure
arguments? | | 2 |
| which of the following go out of the loopo if expn 2
becoming false
a.while(expn 1){...if(expn 2)continue;}
b.while(!expn 1){if(expn 2)continue;...}
c.do{..if(expn 1)continue;..}while(expn 2);
d.while(!expn 2){if(expn 1)continue;..}
| TCS | 2 |
| How do we swap or interchange any 2 numbers without using
Temporary variable...Anybody can pls answer it.. Thanks in
Advance | | 7 |
| How to receive strings with spaces in scanf() | | 4 |
| convert 0.9375 to binary | CTS | 1 |
| 12. 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 | 4 |
| Write a program in c to input a 5 digit number and print it
in words. | | 1 |
| 6. Which of the Following is not defined in string.h?
A)strspn()
B)strerror()
C)memchr()
D)strod()
| Accenture | 1 |
| where does malloc() function get the memory? | | 1 |
| write a program to print the all 4digits numbers & whose
squares must me even numbers? | Virtusa | 2 |
| Design a program using an array that lists even numbers and
odd numbers separately from the 12 numbers supplied by a user. | | 7 |
| Why doesn't the code "a[i] = i++;" work? | | 4 |
| difference between semaphores and mutex? | | 1 |
| i want explaination about the program and its stack reprasetaion
fibbo(int n)
{
if(n==1 or n==0)
return n;
else
return fibbo(n-1)+fibbo(n-2);
}
main()
{
fibbo(6);
}
| | 2 |
| pgm to find middle element of linklist(in efficent manner) | Huawei | 2 |
| What are bit fields? What is their use? | Adobe | 1 |
| Print all the palindrome numbers.If a number is not
palindrome make it one by attaching the reverse to it.
eg:123
output:123321 (or) 12321 | | 2 |
| |
| For more C Interview Questions Click Here |