| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
|
I need to take a sentence from input and sort the words
alphabetically using the C programming language.
Note: This is C not C++.
qsort and strtok not allowed | | 4 |
| int arr[] = {1,2,3,4}
int *ptr=arr;
*(arr+3) = *++ptr + *ptr++;
Final contents of arr[]
| Hughes | 4 |
| 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 |
| int zap(int n)
{
if(n<=1)then zap=1;
else zap=zap(n-3)+zap(n-1);
}
then the call zap(6) gives the values of zap
[a] 8 [b] 9 [c] 6 [d] 12 [e] 15
| Wipro | 8 |
| What is the real difference between arrays and pointers? | | 11 |
| What is the difference between null pointer and void pointer | CTS | 3 |
| How to convert a binary number to Hexa decimal number??
(Note:Do not convert it into binary and to Hexadecimal) | Subex | 1 |
| Can u return two values using return keyword? If yes, how?
If no, why? | | 7 |
| What is the purpose of Scanf Print, getchar, putchar,
function? | | 2 |
| How do you write a program which produces its own source
code as its output? | | 3 |
| what is call by value and call by reference | | 2 |
| is compiler do read the data line by line or not.
?? | LG-Soft | 3 |
| Which command is more efficient?
*(ptr+1) or ptr[1] | | 3 |
| #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 |
| what is object oriental programing? | | 1 |
| How to implement variable argument functions ? | HP | 1 |
| what is op?
for(c=0;c=1000;c++)
printf("%c",c); | Trigent | 18 |
| Write a program to print all the prime numbers with in the
given range | ABC | 1 |
| How to write a program for swapping two strings without
using 3rd variable and without using string functions. | iGate | 5 |
| create an SINGLE LINKED LISTS and reverse the data in the
lists completely | | 3 |
| |
| For more C Interview Questions Click Here |