| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| IS STRUCTURES CAN BE USED WITHIN AN ARRAY? | Caritor | 7 |
| how can we use static and extern?and where can we use this? | Excel | 3 |
| which of the following statements is incorrect
a.typedef struct new{
int n1;
char n2;
} DATA;
b.typedef struct {
int n3;
char *n4;
}ICE;
c.typedef union {
int n5;
float n6;
} UDT;
d.#typedef union {
int n7;
float n8;
} TUDAT;
| TCS | 5 |
| how does the C compiler interpret the following two statements
p=p+x;
q=q+y;
a.p=p+x;
q=q+y
b.p=p+xq=q+y
c.p=p+xq;
q=q+y
d.p=p+x/q=q+y
| TCS | 3 |
| #define swap1(a,b) a=a+b;b=a-b;a=a-b;
main()
{
int x=5,y=10;
swap1(x,y);
printf("%d %d\n",x,y);
swap2(x,y);
printf("%d %d\n",x,y);
}
int swap2(int a,int b)
{
int temp;
temp=a;
b=a;
a=temp;
return;
}
what are the outputs? | Ramco | 4 |
| In the following control structure which is faster?
1.Switch
2.If-else
and which consumes more memory? | | 4 |
| how can i make a program with this kind of output..
Enter a number: 5
0
01
012
0123
01234
012345
01234
0123
012
01
0 | Wipro | 3 |
| what will be the output:
main(){char ch;int a=10;printf("%d",ch);} | Wipro | 29 |
| What are bit fields? What is their use? | Adobe | 1 |
| 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 |
| write a program to check whether a given integer is a strong
number or not?
[Hint:
145=1!+4!+5!
=1+24+120
=145]
| | 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 |
| What is the real difference between arrays and pointers? | | 11 |
| declare afunction pointer to int printf(char *)? | HCL | 1 |
| write a program in 'c' to find the value of p[i+1]^n.p,i,n
are arguments of a macro and n is a integer | | 1 |
| what are the languages used in c#? | Infosys | 1 |
| write a program to print the all 4digits numbers & whose
squares must me even numbers? | Virtusa | 2 |
| compute the nth mumber in the fibonacci sequence? | TCS | 7 |
| what does the following function print?
func(int i)
{
if(i%2)return 0;
eale return 1;
}
main()
{
int =3;
i=func(i);
i=func(i);
printf("%d",i);}
| TCS | 8 |
| how to find that no is int or float? | | 5 |
| |
| For more C Interview Questions Click Here |