| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| 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 |
| I have a function which accepts a pointer to an int. How
can I pass a constant like 5 to it? | | 3 |
| How to reverse a string using a recursive function, without
swapping or using an extra memory? | Motorola | 18 |
| how to display 2-D array elements in spiral | | 1 |
| Write code for atoi(x) where x is hexadecimal string. | Adobe | 2 |
| plz answer..... a program that reads non-negative integer
and computes and prints its factorial | | 2 |
| In the following control structure which is faster?
1.Switch
2.If-else
and which consumes more memory? | | 4 |
| When is an interface "good"?
| | 1 |
| Struct(s)
{
int a;
long b;
}
Union (u)
{int a;
long b;
}
Print sizeof(s)and sizeof(u) if sizeof(int)=4 and
sizeof(long)=4
| Mascot | 2 |
| 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 |
| what is the definition of storage classes? | Wipro | 2 |
| Is the C language is the portable language...If yes...Then
Why...and if not then what is problem so it is not a
Portable language..??? | TCS | 1 |
| what are the general concepts of c and c++ | | 1 |
| what is the output of the following program?
#include<stdio.h>
void main()
{
float x=1.1;
while(x==1.1)
{
printf("\n%f",x);
x=x-0.1;
}
} | | 4 |
| int a=1,b=2,c=3;
printf("%d,%d",a,b,c);
What is the output?
| Verifone | 14 |
| Write one statement equalent to the following two statements
x=sqr(a);
return(x);
Choose from one of the alternatives
a.return(sqr(a));
b.printf("sqr(a)");
c.return(a*a*a);
d.printf("%d",sqr(a));
| TCS | 4 |
| Write a program to accept a character & display its
corrosponding ASCII value & vice versa? | | 4 |
| 1.what are local and global variables?
2.what is the scope of static variables?
3.what is the difference between static and global variables?
4.what are volatile variables?
5.what is the use of 'auto' keyword?
6.how do we make a global variable accessible across files?
Explain the extern keyword?
7.what is a function prototype?
8.what does keyword 'extern' mean in a function declaration?
| | 1 |
| pgm to reverse string using arrays i.e god is love becomes
love is god)
(assumption:only space is used for seperation of words)
no addtional memory used.i.e no temporary arrays can used. | Persistent | 4 |
| What are data breakpoints? | Adobe | 1 |
| |
| For more C Interview Questions Click Here |