| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| Please list all the unary and binary operators in C. | | 1 |
| what does the following function print?
func(int i)
{
if(i%2)return 0;
eale return 1;
}
main()
{
int =3;
i=func(i);
i=func(i);
printf("%d",i);}
| TCS | 8 |
| plz answer..... a program that reads non-negative integer
and computes and prints its factorial | | 2 |
| why i join syntel? | Syntel | 12 |
| main()
{int a=200*200/100;
printf("%d",a);
} | TCS | 7 |
| #include
main()
{
int i=1,j=2;
switch(i)
{
case 1: printf("GOOD");
break;
case j: printf("BAD");
break;
}
}
| ME | 5 |
| Explain what?s happening in the first constructor: public
class c{ public c(string a) : this() {;}; public c() {;} }
How is this construct useful?
| | 1 |
| 6)swap(int x,y)
{
int temp;
temp=x;
x=y;
y=temp;
}
main()
{
int x=2;y=3;
swap(x,y);
}
after calling swap ,what are yhe values x&y?
| | 2 |
| the code is::::: if(condition)
printf("hello");
else
printf("world");
WHAT WILL BE THE CONDITION IN IF IN SUCH A WAY THAT BOTH
HELLO AND WORLD ARE PRINTED IN A SINGLE ATTEMPT?????? SINGLE
ATTEMPT IN THE SENSE... IT MUST FIRST PRINT "HELLO" AND IT
MUST GO TO ELSE PART AND PRINT "WORLD"..... NO LOOPS,
RECURSION ARE ALLOWED........................ | IBM | 9 |
| x=2,y=6,z=6
x=y==z;
printf(%d",x)
| HCL | 8 |
| 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 |
| Program to find the value of e raised to power x using while
loop | N-Tech | 3 |
| what is the function of void main()? | | 6 |
| 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 |
| how to find a 5th bit is set in c program | IBM | 3 |
| writw a program to insert an element in the begning of a
doubly linked list | | 1 |
| what is difference between overriding and overloading? | | 1 |
| which header file contains main() function in c? | TCS | 3 |
| What are advantages and disadvantages of recursive
calling ? | HP | 11 |
| Go through the following code sinippet
char a[20];
a="Hello Orcale Test";
will this compile?
| Oracle | 3 |
| |
| For more C Interview Questions Click Here |