| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| What is the purpose of Scanf Print, getchar, putchar,
function? | | 2 |
| What is the difference b/w main() in C language and main()
in C++. | | 6 |
| write program on arrays
| GE | 2 |
| 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 |
| Which is not valid in C?
1) class aClass{public:int x;}
2) /* A comment */
3) char x=12;
| | 5 |
| #include<stdio.h>
main()
{
char s1[]="Ramco";
char s2[]="Systems";
s1=s2;
printf("%s",s1);
}
Find the output | CitiGroup | 4 |
| What are the different pointer models in c? | | 3 |
| pick out the odd one out of the following
a.malloc()
b.calloc()
c.free()
d.realloc()
| TCS | 1 |
| identify the in correct expression
a.a=b=3=4;
b.a=b=c=d=0;
float a=int b=3.5;
d.int a;
float b;
a=b=3.5;
| TCS | 5 |
| How do you write a program which produces its own source
code as its output? | | 3 |
| Can I pass constant values to functions which accept structure
arguments? | | 2 |
| what does the following code do?
fn(int n,int p,int r)
{
static int a=p;
switch(n){
case 4:a+=a*r;
case 3:a+=a*r;
case 2:a+=a*r;
case 1:a+=a*r;
}
}
a.computes simple interest for one year
b.computes amount on compound interest for 1 to 4 years
c.computes simple interest for four year
d.computes compound interst for 1 year
| TCS | 4 |
| How to reverse a string using a recursive function, without
swapping or using an extra memory? | Motorola | 18 |
| What is the main differences between C and Embedded C? | | 2 |
| totally how much header files r in c language | TCS | 4 |
| differentiate between
const char *a;
char *const a; and
char const *a;
| HCL | 1 |
| int main()
{
int *p=new int;
*p=10;
del p;
cout<<*p;
*p= 60;
cout<<*p;
}
what will be the output & why? | TCS | 4 |
| which one is not preprocessor directive
a)#if b)#elif c)#undef d)#pragma
| Wipro | 13 |
| can i know the source code for reversing a linked list with
out using a temporary variable?
| Honeywell | 6 |
| Write a program in c to input a 5 digit number and print it
in words. | | 1 |
| |
| For more C Interview Questions Click Here |