| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| Give a fast way to multiply a number by 7 | Microsoft | 8 |
| how to display 2-D array elements in spiral | | 1 |
| Write a C Programm..
we press 'a' , it shows the albhabetical number is 1, if we
press 'g' it shows the answer 7.. any can help me | | 4 |
| write a 'c' program to sum the number of integer values | | 5 |
| Dear Sir,
we are required the bubble sorting programs
Regs
Prem | | 1 |
| what is the difference between getch() and getchar()? | | 5 |
| Write code for finding depth of tree | Adobe | 1 |
| what is the use of fflush() function? | | 1 |
| what is the differnce between AF_INET and PF_INET? | Wipro | 2 |
| What's wrong with "char *p = malloc(10);" ? | | 4 |
| 9.how do you write a function that takes a variable number
of arguments? What is the prototype of printf () function?
10.How do you access command-line arguments?
11.what does ‘#include<stdio.h>’ mean?
12.what is the difference between #include<> and #include”…”?
13.what are # pragma staments?
14.what is the most appropriate way to write a
multi-statement macro? | L&T | 4 |
| main()
{
char *p1="Name";
char *p2;
p2=(char *)malloc(20);
while(*p2++=*p1++);
printf("%s\n",p2);
}
what is the output?
| Ramco | 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 |
| who is the founder of c | HP | 9 |
| what is the use of using linked list and array? | Infosys | 9 |
| Can you think of a way when a program crashed before
reaching main? If yes how? | | 2 |
| 18)struct base {int a,b;
base();
int virtual function1();
}
struct derv1:base{
int b,c,d;
derv1()
int virtual function1();
}
struct derv2 : base
{int a,e;
}
base::base()
{
a=2;b=3;
}
derv1::derv1(){
b=5;
c=10;d=11;}
base::function1()
{return(100);
}
derv1::function1()
{
return(200);
}
main()
base ba;
derv1 d1,d2;
printf("%d %d",d1.a,d1.b)
o/p is
a)a=2;b=3;
b)a=3; b=2;
c)a=5; b=10;
d)none
19) for the above program answer the following q's
main()
base da;
derv1 d1;
derv2 d2;
printf("%d %d %d",da.function1(),d1.function1(),d2.function1
());
o/p is
a)100,200,200;
b)200,100,200;
c)200,200,100;
d)none
20)struct {
int x;
int y;
}abc;
you can not access x by the following
1)abc-->x;
2)abc[0]-->x;
abc.x;
(abc)-->x;
a)1,2,3
b)2&3
c)1&2
d)1,3,4
| | 1 |
| How to write a program for swapping two strings without
using 3rd variable and without using string functions. | iGate | 5 |
| What is encapsulation? | | 1 |
| what is calloc and malloc? | | 1 |
| |
| For more C Interview Questions Click Here |