| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| 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 |
| Toggle nth bit in a given integer - num | Qualcomm | 2 |
| proc() {
static i=10;
printf("%d",i);
}
If this proc() is called second time, what is the output?
| Hughes | 5 |
| totally how much header files r in c language | TCS | 4 |
| How can I allocate arrays or structures bigger than 64K? | | 4 |
| what are the languages used in c#? | Infosys | 1 |
| Which of the Following is not defined in string.h?
A)strspn()
B)strerror()
C)memchr()
D)strod()
| Accenture | 1 |
| Write a program to accept a character & display its
corrosponding ASCII value & vice versa? | | 4 |
| program to find the ASCII value of a number | | 5 |
| how to implement stack operation using singly linked list | | 1 |
| #include<stdio.h>
main()
{
char s1[]="Ramco";
char s2[]="Systems";
s1=s2;
printf("%s",s1);
}
Find the output | CitiGroup | 4 |
| what is the size of an integer variable? | | 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 |
| write a own function to compare two strings with out using
stringcomparition function? | LG-Soft | 3 |
| do ne body have any idea about the salary for the we r going
to have interview.
yup .. u got it right ..i m talking abt NIC. | | 1 |
| Explain in detail how strset (string handling function
works )pls explain it with an example. | | 1 |
| We can draw a box in cprogram by using only one printf();&
without using graphic.h header file? | NIIT | 3 |
| void main()
{
int s[4][2]={ {1234,56},{1212,33},{1434,80},{1312,78} };
int (*p)[2];
int i,j,*pint;
for(i=0;i<=3;i++)
{
p=&s[i];
pint=p;
printf("\n");
for(j=0;j<=1;j++)
printf("%d",*(pint+j));
}
} while running this program it shows a warning-suspicious
pointer conversion ie pint=p; my que is why should we assign
the value of p to pint again.why cant we use it directly as
*(p+j)..but if i use like tat the o/p is garbage value.. | | 1 |
| can we write a program in c for printf and scanf without
using header file stdio.h | | 1 |
| What's wrong with "char *p; *p = malloc(10);"? | | 5 |
| |
| For more C Interview Questions Click Here |