| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| explain about storage of union elements. | Bosch | 2 |
| Given an array of length N containing integers between 1
and N, determine if it contains any duplicates. | SilverKey | 2 |
| how does printf function work | | 1 |
| what is the function of .h in #include<stdio.h> in c ? | IBM | 9 |
| if array a conatins 'n' elements and array b conatins 'n-1'
elements.array b has all element which are present in array
a but one element is missing in array b. find that
element. | Zycus-Infotech | 9 |
| wite a programme in c to linear search a data using flag and
without using flags? | TCS | 3 |
| how to make c program without a libary?
e.g.#include<stdio.h> libary is not in c progaram. | | 1 |
| What's the best way to declare and define global variables? | | 5 |
| What will be the result of the following program?
main()
{
char p[]="String";
int x=0;
if(p=="String")
{
printf("Pass 1");
if(p[sizeof(p)-2]=='g')
printf("Pass 2");
else
printf("Fail 2");
}
else
{
printf("Fail 1");
if(p[sizeof(p)-2]=='g')
printf("Pass 2");
else
printf("Fail 2");
}
}
a) Pass 1, Pass 2
b) Fail 1, Fail 2
c) Pass 1, Fail 2
d) Fail 1, Pass 2
e) syntax error during compilation
| IBM | 10 |
| How do we swap or interchange any 2 numbers without using
Temporary variable...Anybody can pls answer it.. Thanks in
Advance | | 7 |
| which of the function operator cannot be over loaded
a) <=
b)?:
c)==
d)*
| HCL | 7 |
| 24.what is a void pointer?
25.why arithmetic operation can’t be performed on a void
pointer?
26.differentiate between const char *a; char *const a;
and char const *a;
27.compare array with pointer?
28.what is a NULL pointer?
29.what does ‘segmentation violation’ mean?
30.what does ‘Bus Error’ mean?
31.Define function pointers?
32.How do you initialize function pointers? Give an example?
33.where can function pointers be used? | | 1 |
| 12. 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 | 4 |
| write a program that explain #define and # undef directive | | 1 |
| WAP TO ACCEPT STRING AND COUNT A COMES N TIMES B COMES N
TIMES C COMES N TIMES D COMES N TIMES AND SO ON.........
AT LAST UNTIL Z COMES N TIMES...............
| | 3 |
| How to avoid structure padding in C? | Tech-Mahindra | 4 |
| What is memmove? | Oracle | 1 |
| what is difference between ++(*p) and (*p)++ | Accenture | 15 |
| void main(int argc,char *argv[],char *env[])
{
int i;
for(i=1;i<argc;i++)
printf("%s",env[i]);
} | | 2 |
| Tell us the difference between these two :
#include"stdio.h"
#include<stdio.h>
define in detial. | | 4 |
| |
| For more C Interview Questions Click Here |