| 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 |
| two variables are added answer is stored on not for third
variable how it is possible? | | 3 |
| what does the following function print?
func(int i)
{
if(i%2)return 0;
eale return 1;
}
main()
{
int =3;
i=func(i);
i=func(i);
printf("%d",i);}
| TCS | 8 |
| Which of the following sorts is quickest when sorting the
following set: 1 2 3 5 4
1) Quick Sort
2) Bubble Sort
3) Merge Sort
| | 5 |
| Predict the output or error(s) for the following:
25. main()
{
printf("%p",main);
}
| ME | 3 |
| main()
{int a=200*200/100;
printf("%d",a);
} | TCS | 7 |
| convert 12345 to 54321 withoutusing strig | | 3 |
| How can I get Single byte from 'int' type variable? Can we
alter single bit or multiple bits in int type variable? if so,
How? | | 2 |
| read the folllowing code
# define MAX 100
# define MIN 100
....
....
if(x>MAX)
x=1;
else if(x<MIN)
x=-1;
x=50;
if the initial value of x=200,what is the vlaue after
executing this code?
a.200
b.1
c.-1
d.50
| TCS | 2 |
| what information does the header files contain? | BSNL | 5 |
| How to implement call back functions ? | HP | 2 |
| Program to display given 3 integers in ascending order | N-Tech | 1 |
| Evaluate the following:
int fn(int v)
{
if(v==1 || v==0)
return 1;
if(v%2==0)
return fn(v/2)+2;
else
return fn(v-1)+3;
}
for fn(7);
1) 10
2) 11
3) 1
| | 6 |
| What is volatile | | 2 |
| 2. Counting in Lojban, an artificial language developed
over the last fourty years, is easier than in most languages
The numbers from zero to nine are:
0 no
1 pa
2 re
3 ci
4 vo
5 mk
6 xa
7 ze
8 bi
9 so
Larger numbers are created by gluing the digit togather.
For Examle 123 is pareci
Write a program that reads in a lojban string(representing
a no less than or equal to 1,000,000) and output it in
numbers.
| Nagarro | 2 |
| Write a program which take a integer from user and tell
whether the given variable is squar of some number or not.
eg: is this number is 1,4,9,16... or not
| Alcatel | 8 |
| What will be printed as the result of the operation below:
#include<..>
int x;
int modifyvalue()
{
return(x+=10);
}
int changevalue(int x)
{
return(x+=1);
}
void main()
{
int x=10;
x++;
changevalue(x);
x++;
modifyvalue();
printf("First output:%d\n",x);
x++;
changevalue(x);
printf("Second output:%d\n",x);
modifyvalue();
printf("Third output:%d\n",x);
} | | 2 |
| How do we swap or interchange any 2 numbers without using
Temporary variable...Anybody can pls answer it.. Thanks in
Advance | | 7 |
| main()
{char a[10]={1,2,3,4,5,6};int x;
for(x=0;x<4;x++){ b[x]=x+'a';}
printf("%s",b);}
| | 3 |
| enum day = { jan = 1 ,feb=4, april, may}
what is the value of may?
a)4 b)5 c)6 d)11
e)none of the above
| HCL | 2 |
| |
| For more C Interview Questions Click Here |