| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| 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 |
| Write a program that takes three variables(a,b,c) in as
separate parameters and rotates the values stored so that
value a goes to b,b,to c and c to a | | 3 |
| logic for generating all the combinations of the any number
of given letters.
ex:::::::::
if a,b,c,d are given the o/p should be
abcd,dcba,dbac,bcad,................
4*3*2*1 combinations............ | Infosys | 2 |
| How to avoid structure padding in C? | Tech-Mahindra | 4 |
| I have a function which accepts a pointer to an int. How
can I pass a constant like 5 to it? | | 3 |
| pgm to reverse string using arrays i.e god is love becomes
love is god)
(assumption:only space is used for seperation of words)
no addtional memory used.i.e no temporary arrays can used. | Persistent | 4 |
| 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 |
| what is call by value and call by reference | | 2 |
| what are the general concepts of c and c++ | | 1 |
| how to find the size of the data type like int,float
without using the sizeof operator? | | 7 |
| void main(int argc,char *argv[],char *env[])
{
int i;
for(i=1;i<argc;i++)
printf("%s",env[i]);
} | | 2 |
| WAP to convert text into its ASCII Code and also write a
function to decode the text given? | | 2 |
| The C language terminator is
a.semicolon
b.colon
c.period
d.exclamation mark
| TCS | 3 |
| program for comparing 2 strings without strcmp() | | 3 |
| What is the meaning When we write "#include" what is # and
what does include does there??? | HCL | 11 |
| the factorial of non-negative integer n is written n! and
is defined as follows:
n!=n*(n-1)*(n-2)........1(for values of n greater than or
equal to 1 and
n!=1(for n=0)
Perform the following
1.write a c program that reads a non-negative integer and
computes and prints its factorial.
2. write a C program that estimates the value of the
mathematical constant e by using the formula:
e=1+1/!+1/2!+1/3!+....
3. write a c program the computes the value ex by using the
formula
ex=1+x/1!+xsquare/2!+xcube/3!+....
| Ignou | 2 |
| wat is the difference between a definition and declaration?
float y;---it looks like a declaration..but it s a
definition.how?someone explain | | 3 |
| what is diff b/w huge & far & near pointer?? | HCL | 1 |
| wap in c to accept n number display the highest and lowest
value | | 2 |
| #define f(x)
main()
{
printf("\n%d",f(2+2));
} | | 3 |
| |
| For more C Interview Questions Click Here |