| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| f(x,y,z)
{
y = y+1;
z = z+x;
}
main()
{
int a,b;
a = 2
b = 2;
f(a+b,a,a);
print a;
}
what is the value of 'a' printed | | 4 |
| YBJBU6 | | 1 |
| what will be the result of the following program ?
char *gxxx()
{
static char xxx[1024];
return xxx;
}
main()
{
char *g="string";
strcpy(gxxx(),g);
g = gxxx();
strcpy(g,"oldstring");
printf("The string is :
%s",gxxx());
}
a) The string is : string
b) The string is :Oldstring
c) Run time error/Core dump
d) Syntax error during compilation
e) None of these
| IBM | 2 |
| How to add two numbers without using arithmetic operators? | Sapient | 7 |
| HOW TO SWAP TWO NOS IN ONE STEP? | Satyam | 10 |
| write the function int countchtr(char string[],int
ch);which returns the number of timesthe character ch
appears in the string. for example the call countchtr("she
lives in Newyork",'e') would return 3. | | 4 |
| How can I find out how much memory is available? | Persistent | 1 |
| write the program for maximum of the following numbers?
122,198,290,71,143,325,98 | | 3 |
| write a C code
to reverse a string using a recursive function, without
swapping or using an extra memory.
| Motorola | 2 |
| Program to write some contents into a file using file
operations with proper error messages. | | 1 |
| main()
{
int x=5;
printf("%d %d %d\n",x,x<<2,x>>2);
}
| CitiGroup | 3 |
| What is false about the following
A compound statement is
a.A set of simple statments
b.Demarcated on either side by curly brackets
c.Can be used in place of simple statement
d.A C function is not a compound statement.
| TCS | 1 |
| 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
| | 3 |
| how to find the kth smallest element in the given list of
array elemnts.
| Silicon | 3 |
| please give me some tips for the selection in TCS. | TCS | 3 |
| What is the difference between char a[] = "string"; and
char *p = "string"; ? | Honeywell | 8 |
| pgm to find number of words starting with capital letters
in a file(additional memory usage not allowed)(if a word
starting with capital also next letter in word is capital
cann't be counted twice) | Subex | 1 |
| 1,4,8,13,21,30,36,45,54,63,73,?,?. | Franklin-Templeton | 3 |
| main()
{
int x=20,y=35;
x = y++ + x++;
y = ++y + ++x;
printf("%d %d\n",x,y);
}
what is the output? | Ramco | 4 |
| difference between function & structure | Verizon | 3 |
| |
| For more C Interview Questions Click Here |