| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| Whats wrong with the following function
char *string()
{
char *text[20];
strcpy(text,"Hello world");
return text;
} | Qualcomm | 3 |
| HOW TO FIND OUT THE RREVERS OF A GIVEN DIGIT NUMBER IF IT
IS INPUT THROUGH THE KEYBORD BY USING C LANGUAGE | | 2 |
| how to implement stack operation using singly linked list | | 1 |
| Main must be written as
a.the first function in the program
b.Second function in the program
c.Last function in the program
d.any where in the program
| TCS | 12 |
| Why is conio.h not required when we save a file as .c and
use clrscr() or getch() ? | | 2 |
| what is the function of .h in #include<stdio.h> in c ? | IBM | 9 |
| What's wrong with the call "fopen ("c:\newdir\file.dat", "r")"? | | 1 |
| f(char *p)
{
p=(char *)malloc(sizeof(6));
strcpy(p,"HELLO");
}
main()
{
char *p="BYE";
f(p)
printf("%s",p);
}
what is the output?
| Hughes | 6 |
| Write a C program that reads a series of strings and prints
only those ending in "ed" | | 2 |
| what is the output of the following program?
main()
{
int i=-1,j=-1,k=0,l=2,m;
m=i++&&j++&&k++||l++;
printf("%d %d %d %d %d",i,j,k,l,m);
} | | 7 |
| 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 |
| How do I declare a pointer to an array? | | 5 |
| #define min((a),(b)) ((a)<(b))?(a):(b)
main()
{
int i=0,a[20],*ptr;
ptr=a;
while(min(ptr++,&a[9])<&a[8]) i=i+1;
printf("i=%d\n",i);}
| | 3 |
| regarding the scope of the varibles;identify the incorrect
statement:
a.automatic variables are automatically initialised to 0
b.static variables are are automatically initialised to 0
c.the address of a register variable is not accessiable
d.static variables cannot be initialised with any expression
| TCS | 1 |
| can we access one file to one directory? | | 1 |
| How to use c/c++ code in JAVA | Satyam | 7 |
| how many argument we can pas in in a function | CTS | 20 |
| #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 |
| Write a C function to search a number in the given list of
numbers. donot use printf and scanf | Honeywell | 6 |
| 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 |
| |
| For more C Interview Questions Click Here |