| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| how can i make a program with this kind of output..
Enter a number: 5
0
01
012
0123
01234
012345
01234
0123
012
01
0 | Wipro | 3 |
| Find string palindrome 10marks
| Honeywell | 5 |
| Whats wrong with the following function
char *string()
{
char *text[20];
strcpy(text,"Hello world");
return text;
} | Qualcomm | 3 |
| 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 |
| why java is called as a purely oops language. | | 2 |
| how many times does the loop iterated ?
for (i=0;i=10;i+=2)
printf("Hi\n");
| TCS | 7 |
| long int size
a) 4 bytes b) 2 bytes c) compiler dependent d) 8 bytes
| HCL | 11 |
| 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 |
| what is the difference between these initializations?
Char a[]=”string”;
Char *p=”literal”;
Does *p++ increment p, or what it points to?
| | 2 |
| Identify the correct argument for the function call fflush
() in ANSI C:
A)stdout
B)stdin
C)stderr
D)All the above
| Accenture | 3 |
| difference between memcpy and strcpy | | 1 |
| How can I allocate arrays or structures bigger than 64K? | | 4 |
| what's the return value of malloc() | | 8 |
| helllo sir ,
what is the main use of the pointer ,array ,and the
structure with the example of a programe | | 2 |
| int i =10
main()
{
int i =20,n;
for(n=0;n<=i;)
{
int i=10
i++;
}
printf("%d", i);
| HCL | 5 |
| what are the static variables
| HCL | 7 |
| pgm to find number of words starting with capital letters
in a file(additional memory usage not allowed)(if a word
starting with capital also next letter in word is capital
cann't be counted twice) | Subex | 1 |
| which type of question asked from c / c++ in interview. | | 2 |
| Why does not use getgh(); and <conio.h> in c language. | Elofic | 2 |
| #define min((a),(b)) ((a)<(b))?(a):(b)
main()
{
int i=0,a[20],*ptr;
ptr=a;
while(min(ptr++,&a[9])<&a[8]) i=i+1;
printf("i=%d\n",i);}
| | 3 |
| |
| For more C Interview Questions Click Here |