| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| Given an unsigned integer, find if the number is power of 2? | | 3 |
| is compiler do read the data line by line or not.
?? | LG-Soft | 3 |
| how to find the binary of a number? | Infosys | 5 |
| 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 |
| What will be printed as the result of the operation below:
#include<..>
int x;
int modifyvalue()
{
return(x+=10);
}
int changevalue(int x)
{
return(x+=1);
}
void main()
{
int x=10;
x++;
changevalue(x);
x++;
modifyvalue();
printf("First output:%d\n",x);
x++;
changevalue(x);
printf("Second output:%d\n",x);
modifyvalue();
printf("Third output:%d\n",x);
} | | 2 |
| how to find the size of the data type like int,float
without using the sizeof operator? | | 7 |
| main()
{int a=200*200/100;
printf("%d",a);
} | TCS | 7 |
| what is the difference between #include<> and #include”…”? | | 1 |
| #include<stdio.h>
int fun();
int i;
int main()
{
while(i)
{
fun();
main();
}
printf("hello \n");
return 0;
}
int fun()
{
printf("hi");
}
answer is hello.how??wat is tat while(i) mean? | Intel | 4 |
| What is external and internal variables
What is dynamic memory allocation
what is storage classes in C | | 2 |
| what does the following code do?
fn(int n,int p,int r)
{
static int a=p;
switch(n){
case 4:a+=a*r;
case 3:a+=a*r;
case 2:a+=a*r;
case 1:a+=a*r;
}
}
a.computes simple interest for one year
b.computes amount on compound interest for 1 to 4 years
c.computes simple interest for four year
d.computes compound interst for 1 year
| TCS | 4 |
| Determine if a number is a power of 2 at O(1). | | 1 |
| write a program to check whether a given integer is a strong
number or not?
[Hint:
145=1!+4!+5!
=1+24+120
=145]
| | 2 |
| here is a link to download Let_Us_C_-_Yashwant_Kanetkar | | 2 |
| what is the use of call back function in c?tell me with
example | | 1 |
| what are the difference between ANSI C and Let Us c and Turbo C | LG-Soft | 1 |
| How can I invoke another program from within a C program? | | 6 |
| void main()
{
char far *farther,*farthest;
printf("%d..%d",sizeof(farther),sizeof(farthest));
}
| ME | 3 |
| Dear Sir,
we are required the bubble sorting programs
Regs
Prem | | 1 |
| Write a C program to print 1 2 3 ... 100 without using
loops? | | 5 |
| |
| For more C Interview Questions Click Here |