| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| Program to write some contents into a file using file
operations with proper error messages. | | 1 |
| write a function for strtok()?? | Verifone | 1 |
| Program to trim a given character from a string. | NetApp | 4 |
| sqrt(x+sqrt(x+sqrt(x+sqrt(x))))=2;
Find the value of x? | Subex | 2 |
| prototype of sine function. | Cadence | 2 |
| what is the output of the following program?
main()
{
int i=-1,j=-1,k=0,l=2,m;
m=i++&&j++&&k++||l++;
printf("%d %d %d %d %d",i,j,k,l,m);
} | | 7 |
| Determine if a number is a power of 2 at O(1). | | 1 |
| two progs are given. one starts counting frm 0 to MAX and
the other stars frm MAX to 0. which one executes fast.
| Verifone | 5 |
| Why cann't whole array can be passed to function as value. | | 1 |
| 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 | 3 |
| 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 |
| biggest of two no's with out using if condition statement | | 2 |
| hello friends
what do u mean by BUS ERROR
i got this error while i am doing my program in DATA STRUCTURES | Wipro | 2 |
| What is volatile in c language? | HCL | 1 |
| WAP to accept first name,middle name & last name of a
student display its initials? | NIIT | 2 |
| what are the interview question's in the language c | Nipuna | 1 |
| what information does the header files contain? | BSNL | 5 |
| What does extern mean in a function declaration? | | 2 |
| post new interiew question and aptitude test papers | | 1 |
| 6)swap(int x,y)
{
int temp;
temp=x;
x=y;
y=temp;
}
main()
{
int x=2;y=3;
swap(x,y);
}
after calling swap ,what are yhe values x&y?
| | 2 |
| |
| For more C Interview Questions Click Here |