| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| How can I prevent other programmers from violating
encapsulation by seeing the private parts of my class? | | 1 |
| 5. What kind of sorting is this:
SORT (k,n)
1.[Loop on I Index]
repeat thru step2 for i=1,2,........n-1
2.[For each pass,get small value]
min=i;
repeat for j=i+1 to N do
{
if K[j]<k[min]
min=j;
}
temp=K[i];K[i]=K[min];K[min]=temp;
3.[Sorted Values will be returned]
A)Bubble Sort
B)Quick Sort
C)Selection Sort
D)Merge Sort
| Accenture | 2 |
| program to find middle element of linklist? | Huawei | 1 |
| What does the message "warning: macro replacement within a
string literal" mean? | | 1 |
| difference between function & structure | Verizon | 5 |
| what is the difference between entry control and exit
control statement? | | 2 |
| wat is the difference between a definition and declaration?
float y;---it looks like a declaration..but it s a
definition.how?someone explain | | 3 |
| what does " calloc" do? | Cadence | 6 |
| what is the use of fflush() function? | | 1 |
| what is the function of .h in #include<stdio.h> in c ? | IBM | 9 |
| what is the output of the following code?
main()
{
int I;
I=0x10+010+10;
printf("x=%x",I);
}
give detailed reason | | 3 |
| what is the use of pointers | | 5 |
| write a C code To reverse a linked list | Motorola | 2 |
| How would you sort a linked list? | | 1 |
| Write a C program to print 1 2 3 ... 100 without using
loops? | | 5 |
| how can i get output like this?
1
2 3
4 5 6 | Excel | 3 |
| 1.write a program to merge the arrays
2.write efficient code for extracting unique elements from a
sorted list of array? | Qualcomm | 2 |
| I have a function which accepts, and is supposed to
initialize,a pointer, but the pointer in the caller remains
unchanged. | | 1 |
| 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 |
| 5. distance conversion:
Convert a distance from miles to kilometers .there are 5280
feets per mile,12 inches per foot .2.54 centimeters per
inch and 100000centimeters per kilometer
| | 1 |
| |
| For more C Interview Questions Click Here |