| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| what is the function of .h in #include<stdio.h> in c ? | IBM | 9 |
| int *a[5] refers to | TCS | 8 |
| write a code for large nos multilication (upto 200 digits) | Persistent | 1 |
| without using arithmatic operator convert an intger variable
x into x+1 | | 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 |
| suppose we use switch statement and we intilize years name
using enum statement like(jan,feb,mar,------dec) we take
integer value as an input .question is that the month which
we analyz is from 0 to 11 bt if i enter 12 than how he
again starts from begning and print jan | | 1 |
| main()
{
printf("\n %d %d %d",sizeof('3'),sizeof("3"),sizeof(3));
}
wat is the o/p and how? | | 7 |
| a memory of 20 bytes is allocated to a string declared as
char *s then the following two statements are executed:
s="Etrance"
l=strlen(s);
what is the value of l ?
a.20
b.8
c.9
d.21
| TCS | 4 |
| main()
{
char *ptr = "Ramco Systems";
(*ptr)++;
printf("%s\n",ptr);
ptr++;
printf("%s\n",ptr);
}
Find the Outputs? | CitiGroup | 7 |
| What are the average number of comparisons required to sort
3 elements? | | 2 |
| What will be printed as the result of the operation below:
#include<..>
int x;
int modifyvalue()
{
return(x+=10);
}
int changevalue(int x)
{
return(x+=1);
}
void main()
{
int x=10;
x++;
changevalue(x);
x++;
modifyvalue();
printf("First output:%d\n",x);
x++;
changevalue(x);
printf("Second output:%d\n",x);
modifyvalue();
printf("Third output:%d\n",x);
} | | 2 |
| 9.how do you write a function that takes a variable number
of arguments? What is the prototype of printf () function?
10.How do you access command-line arguments?
11.what does ‘#include<stdio.h>’ mean?
12.what is the difference between #include<> and #include”…”?
13.what are # pragma staments?
14.what is the most appropriate way to write a
multi-statement macro? | | 1 |
| program to find the ASCII value of a number | | 5 |
| Toggle nth bit in a given integer - num | Qualcomm | 2 |
| What are .h files and what should I put in them? | | 3 |
| void main()
{
int i=5;
printf("%d",i+++++i);
}
| ME | 12 |
| what is memory leak?
| | 3 |
| What is encapsulation? | | 1 |
| Reverse the part of the number which is present from
position i to j. Print the new number.
eg:
num=789876
i=2
j=5
778986 | | 1 |
| c programming of binary addition of two binary numbers
| | 1 |
| |
| For more C Interview Questions Click Here |