| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| What is #pragma directive?how it is used in the program?
what is its advantages and disadvantages? | | 1 |
| what's the o/p
int main(int n, char *argv[])
{
char *s= *++argv;
puts(s);
exit(0);
}
| Motorola | 1 |
| Write a C program that reads a series of strings and prints
only those ending in "ed" | | 2 |
| write a c program to check weather a particluar bit is set
or not? | IBM | 4 |
| what does data structure mean? | | 7 |
| 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 |
| which one of follwoing will read a character from keyboard
and store in c
a)c=getc()
b)c=getchar()
c)c=getchar(stdin)
d)getc(&c)
e)none | | 5 |
| what is disadvantage of pointer in C | Tech-Mahindra | 5 |
| What is the difference between static and global variables? | | 1 |
| What's wrong with "char *p = malloc(10);" ? | | 4 |
| pointer_variable=(typecasting
datatype*)malloc(sizeof(datatype));
This is the syntax for malloc?Please explain this,how it
work with an example? | Excel | 2 |
| What is the function of ceil(X) defined in math.h do?
A)It returns the value rounded down to the next lower
integer
B)it returns the value rounded up to the next higher integer
C)the Next Higher Value
D)the next lower value | Accenture | 3 |
| Find the middle node in the linked list??
(Note:Do not use for loop, count and count/2) | Subex | 2 |
| write a fuction for accepting and replacing lowercase
letter to'Z' with out using inline function. | Temenos | 4 |
| 11. Look at the Code:
#include<string.h>
void main()
{
char s1[]="abcd";
char s2[10];
char s3[]="efgh";
int i;
clrscr();
i=strcmp(strcat(s3,ctrcpy(s2,s1))strcat(s3,"abcd"));
printf("%d",i);
}
What will be the output?
A)No output B) A Non Integer C)0 D) Garbage
| Accenture | 7 |
| is compiler do read the data line by line or not.
?? | LG-Soft | 3 |
| what is out put of the following code?
#include
class Base
{
Base()
{
cout<<"constructor base";
}
~Base()
{
cout<<"destructor base";
}
}
class Derived:public Base
{
Derived()
{
cout<<"constructor derived";
}
~Derived()
{
cout<<"destructor derived";
}
}
void main()
{
Base *var=new Derived();
delete var;
}
| Honeywell | 2 |
| main()
{
printf("hello%d",print("QUARK test?"));
}
| | 4 |
| program to find the roots of a quardratic equation | | 1 |
| What is alloca() and why is its use discouraged? | | 1 |
| |
| For more C Interview Questions Click Here |