| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| Toggle nth bit in a given integer - num | Qualcomm | 2 |
| 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 |
| identify the in correct expression
a.a=b=3=4;
b.a=b=c=d=0;
float a=int b=3.5;
d.int a;
float b;
a=b=3.5;
| TCS | 5 |
| which one is not preprocessor directive
a)#if b)#elif c)#undef d)#pragma
| Wipro | 13 |
| Which of the following are valid "include" formats?
A)#include and #include[file.h]
B)#include (file.h) and #include
C)#include [file.h] and #include "file.h"
D)#include <file.h> and #include "file.h"
| Accenture | 14 |
| Program to trim a given character from a string. | NetApp | 4 |
| int *p=20;
if u print like dis printf("%d",p);
o\p:- 20; how is it possible?
plz give me the explanation. | Global-Edge | 11 |
| How can I prevent other programmers from violating
encapsulation by seeing the private parts of my class? | | 1 |
| convert 12345 to 54321 withoutusing strig | | 3 |
| why division operator not work in case of float constant? | | 1 |
| program to get the remainder and quotant of given two
numbers with out using % and / operators? | IBM | 8 |
| we all know about the function overloading concept used in
C++ and we all learnt abt that.... but that concept is
already came in C in a very smaller propotion ... my
question is IN WHICH CONCEPT THERE IS A USE OF FUNCTION
OVERLOADING IS USED in C language????????????? | Google | 2 |
| What are the average number of comparisons required to sort
3 elements? | | 2 |
| what is meant by the "equivalence of pointers and arrays" in
C? | Satyam | 3 |
| Study the code:
void show()
main()
{
show();
}
void show (char *s)
{
printf("%sn",s);
}
What will happen if it is compiled & run on an ANSI C
Compiler?
A)It will compile & nothing will be printed when it is
executed
B)it will compile but not link
C)the compiler will generate an error
D)the compiler will generate a warning
| Accenture | 4 |
| How do I declare a pointer to an array? | | 5 |
| what is available in C language but not in C++? | | 1 |
| Look at the Code:
main()
{
int a[]={1,2,3},i;
for(i=0;i<3;i++)
{
printf("%d",*a);
a++;
}
}
Which Statement is/are True w.r.t the above code?
I.Executes Successfully & Prints the contents of the array
II.Gives the Error:Lvalue Required
III.The address of the array should not be changed
IV.None of the Above.
A)Only I B)Only II C)II & III D)IV
| Accenture | 3 |
| what is the value of 'i'?
i=strlen("Blue")+strlen("People")/strlen("Red")-strlen("green")
| Cadence | 4 |
| pick out the odd one out of the following
a.malloc()
b.calloc()
c.free()
d.realloc()
| TCS | 1 |
| |
| For more C Interview Questions Click Here |