| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| 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 |
| how to connect oracle in C/C++. | | 2 |
| how to sort two array of characters and make a new array of
characters. | Accenture | 1 |
| what is the other ways to find a logic to print whether a
number is an even or odd wit out using % symbol??????? i
know three different ways to print it. so i need any other
different logic>>>>> | TCS | 3 |
| Reverse the part of the number which is present from
position i to j. Print the new number.[without using the array]
eg:
num=789876
i=2
j=5
778986 | | 2 |
| #define f(x)
main()
{
printf("\n%d",f(2+2));
} | | 3 |
| What will be result of the following program?
void myalloc(char *x, int n)
{
x= (char *)malloc(n*sizeof(char));
memset(x,\0,n*sizeof(char));
}
main()
{
char *g="String";
myalloc(g,20);
strcpy(g,"Oldstring");
printf("The string is %s",g);
}
a) The string is : String
b) Run time error/Core dump
c) The string is : Oldstring
d) Syntax error during compilation
e) None of these
| IBM | 2 |
| f1()
{
f(3);}
f(int t)
{
switch(t);
{
case 2: c=3;
case 3: c=4;
case 4: c=5;
case 5: c=6;
default: c=0;}
value of c?
| Geometric-Software | 5 |
| what is the diference between pointer to the function and
function to the pointer? | | 1 |
| 1,1,5,17,61,217,?,?. | | 3 |
| 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 | 5 |
| What is difference between the following 2 lines….
int temp = (int)(0x00);
int temp = (0x00int);
| Bosch | 3 |
| Which of the Following is not defined in string.h?
A)strspn()
B)strerror()
C)memchr()
D)strod()
| Accenture | 1 |
| Can we write a program without main() function? | | 6 |
| what are the difference between ANSI C and Let Us c and Turbo C | LG-Soft | 1 |
| Here is alphabets : abcdefgh
1) how to reverse. as hgfedcba
2) after reversal, how to group them in a pair hg fe dc ba.
| | 1 |
| What are the uses of pre-processor directives? | | 2 |
| write a program to find the sum of the array elements in c
language? | | 3 |
| which will be first in c compiling ,linking or compiling
,debugging. | Sonata | 2 |
| What are .h files and what should I put in them? | | 3 |
| |
| For more C Interview Questions Click Here |