| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| When you call malloc() to allocate memory for a local
pointer, do you have to explicitly free() it? | | 2 |
| Why doesn't C have nested functions? | | 1 |
| What is the output of the program given below
#include<stdio.h>
main()
{
char i=0;
for(;i>=0;i++) ;
printf("%d\n",i);
} | ADITI | 11 |
| 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 | 2 |
| if a five digit number is input through the keyboard, write
a program to calculate the sum of its digits.
(hint:-use the modulus operator.'%') | | 5 |
| how many argument we can pas in in a function | CTS | 18 |
| What is an volatile variable? | HP | 6 |
| who did come first hen or agg | Infosys | 8 |
| What is the Difference between Class and Struct? | Motorola | 9 |
| int i;
i=2;
i++;
if(i=4)
{
printf(i=4);
}
else
{
printf(i=3);
}
output of the program ?
| Mascot | 5 |
| f(*p)
{
p=(char *)malloc(6);
p="hello";
return;
}
main()
{
char *p="bye";
f(p);
printf("%s",p);
}
what is the o/p?
| Hughes | 2 |
| the format specified for hexa decimal is
a.%d
b.%o
c.%x
d.%u
| TCS | 3 |
| What are the uses of pre-processor directives? | | 2 |
| Add 2 64 bit numbers on a 32 bit machine | NetApp | 1 |
| What's the best way to declare and define global variables? | | 2 |
| Blade logic interview question.
1st round is a written tests with 15 multiple questions
from c and c++. All are simple basic question.
Like int main ()
{
Int i=65;
Return printf(“%c”, i);
}
2nd and 3rd round is technical interview.
The position for which I was interview was core UNIX and c.
Yes it is for system programming.
The company has product name blade server. For their server
they are creating their own command for their purpose.
Example cd command.
We can implement it in a c program by using the chdir()
function.
So the question asks related to PID, fork, pipe, shared
memory, signal.
Write a program in c which will act as cp command.
| BladeLogic | 1 |
| what is differnence b/w macro & functions | | 1 |
| True or false: If you continuously increment a variable, it
will become negative?
1) True
2) False
3) It depends on the variable type
| | 4 |
| what is difference between array of characters and string | Accenture | 8 |
| given the piece of code
int a[50];
int *pa;
pa=a;
to access the 6th element of the array which of the
following is incorrect?
a.*(a+5)
b.a[5]
c.pa[5]
d.*(*pa + 5)
| TCS | 4 |
| |
| For more C Interview Questions Click Here |