| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| Explain the differences between public, protected, private
and internal. | | 1 |
| whether itis a structured language? | Microsoft | 1 |
| struct ptr
{
int a;
char b;
int *p;
}abc;
what is d sizeof structure without using "sizeof" operator?? | Verifone | 8 |
| How would you find a cycle in a linked list?
| | 2 |
| Write a program to generate prime factors of a given integer? | | 3 |
| Can you think of a way when a program crashed before
reaching main? If yes how? | | 2 |
| 18)struct base {int a,b;
base();
int virtual function1();
}
struct derv1:base{
int b,c,d;
derv1()
int virtual function1();
}
struct derv2 : base
{int a,e;
}
base::base()
{
a=2;b=3;
}
derv1::derv1(){
b=5;
c=10;d=11;}
base::function1()
{return(100);
}
derv1::function1()
{
return(200);
}
main()
base ba;
derv1 d1,d2;
printf("%d %d",d1.a,d1.b)
o/p is
a)a=2;b=3;
b)a=3; b=2;
c)a=5; b=10;
d)none
19) for the above program answer the following q's
main()
base da;
derv1 d1;
derv2 d2;
printf("%d %d %d",da.function1(),d1.function1(),d2.function1
());
o/p is
a)100,200,200;
b)200,100,200;
c)200,200,100;
d)none
20)struct {
int x;
int y;
}abc;
you can not access x by the following
1)abc-->x;
2)abc[0]-->x;
abc.x;
(abc)-->x;
a)1,2,3
b)2&3
c)1&2
d)1,3,4
| | 1 |
| Write a C program to print 1 2 3 ... 100 without using
loops? | | 4 |
| write a program to print the all 4digits numbers & whose
squares must me even numbers? | Virtusa | 2 |
| can we access one file to one directory? | | 1 |
| i want to know aptitude questions,technical questions | | 2 |
| code for copying two strings with out strcpy() function. | | 5 |
| what is the difference between <stdio.h> and "stdio.h" | Kanbay | 5 |
| 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 |
| HOW TO HANDLE EXCEPTIONS IN C | | 5 |
| 52.write a “Hello World” program in “c” without using a
semicolon?
53.Give a method to count the number of ones in a 32 bit number?
54.write a program that print itself even if the source file
is deleted?
55.Given an unsigned integer, find if the number is power of 2? | | 5 |
| 1.find the second maximum in an array?
2.how do you create hash table in c?
3.what is hash collision | Qualcomm | 6 |
| Write code for finding depth of tree | Adobe | 1 |
| write the function int countchtr(char string[],int
ch);which returns the number of timesthe character ch
appears in the string. for example the call countchtr("she
lives in Newyork",'e') would return 3. | | 4 |
| WRITE A PROGRAM IN C TO MULTIPLY TWO 2-D ARRAYS | | 4 |
| |
| For more C Interview Questions Click Here |