| Back to Questions Page |
| |
| Question |
wt is d full form of c |
Rank |
Answer Posted By |
|
Question Submitted By :: Satya.babi |
| This Interview Question Asked @ Wipro |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | computing language  |
| Satya.babi |
| |
| |
| Question |
What is volatile in c language? |
Rank |
Answer Posted By |
|
Question Submitted By :: Dhakar123 |
| This Interview Question Asked @ HCL |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | compiler should not make any assumption about the variable
which declared as volatile.  |
| Venkata Mahesh |
| |
| |
| Question |
what is available in C language but not in C++? |
Rank |
Answer Posted By |
|
Question Submitted By :: Maayasweety |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | In c u can create variable with name new and delete but not
in c++.  |
| Mukhtar |
| |
| |
|
|
| |
| Question |
what is self refrential structure |
Rank |
Answer Posted By |
|
Question Submitted By :: Alok.chauhan9 |
| This Interview Question Asked @ HCL |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | if a structure tag is a datatype of a variable or data
member then it is known as a self referential structure.
for ex
template <class t>
struct node
{
t data;
node *link;//here link is a variable which contains data
type of structuretag ie node
}  |
| Silpa |
| |
| |
| Answer | whenever a structure is been pointed by the same structure
pointer which is the member of the same structure is called
as self referential structure....
thank u  |
| Vignesh1988i |
| |
| |
| Question |
write a program to compare 2 numbers without using logical
operators? |
Rank |
Answer Posted By |
|
Question Submitted By :: Maddy143 |
| This Interview Question Asked @ IBM |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | main()
{
int x,y;
sf("%d,%d",&x,&y);
if(x^y)
pf("not equal");
else
pf("equal");
}  |
| Bashu |
| |
| |
| Question |
what is the definition of storage classes? |
Rank |
Answer Posted By |
|
Question Submitted By :: Nirmal |
| This Interview Question Asked @ Wipro |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | at the level of the language as a storage class persistence
is defined on ... A program written in C is passed through
a precompilation phase in which the statements related to
persistence are converted into their corresponding storage
system calls.  |
| Venkata Mahesh |
| |
| |
| Question |
What is the output of following program ?
int
main()
{
int x = 5;
printf("%d %d %d\n", x, x << 2, x >> 2);
} |
Rank |
Answer Posted By |
|
Question Submitted By :: Qint |
| This Interview Question Asked @ Qualcomm |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | 5 20 1  |
| Qint |
| |
| |
| Answer | 4,4,1
coz we shift the bit as 5=101 now shift two bit to right as
101>>2=001
now
2<<001=100
noe x=4
printf execute from right to left so ans is 4,4,1  |
| Krishna Deep Sharma |
| |
| |
| Answer | 4 4 1 is the output....
here the operation of STACK involves.... for these kind of statements (ie) statements having multiple values to get printed it is used..... so the very first element that goes inside stack is x , then x<<2 , then x>>2... so from the TOP it will be operated....
and print as the order given in printf statement..... :)
thank u  |
| Vignesh1988i |
| |
| |
| Question |
Toggle nth bit in a given integer - num |
Rank |
Answer Posted By |
|
Question Submitted By :: Qint |
| This Interview Question Asked @ Qualcomm |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | num ^ (1 << n)  |
| Qint |
| |
| |
| Answer | num=num ^ (1<<(n-1));  |
| Sahil |
| |
| |
| Question |
Binary tree traversing |
Rank |
Answer Posted By |
|
Question Submitted By :: Qint |
| This Interview Question Asked @ Qualcomm |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | void Traverse(Node *t)
{
if(NULL == t)
return;
//in-order traversing
Traverse(t->left);
printf("%d",t->data);
Traverse(t->right);
//pre-order
printf("%d",t->data);
Traverse(t->left);
Traverse(t->right);
//post order
Traverse(t->left);
Traverse(t->right);
printf("%d",t->data);
}  |
| Qint |
| |
| |
| Question |
Whats wrong with the following function
char *string()
{
char *text[20];
strcpy(text,"Hello world");
return text;
} |
Rank |
Answer Posted By |
|
Question Submitted By :: Qint |
| This Interview Question Asked @ Qualcomm |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | 1. returning address of a local variable.
2. wrong parameter passed to strcpy()  |
| Qint |
| |
| |
| Answer | In this question ,two wrong thins ----
1.this is an array of char pointer so use
strcy(text[no.],"Hello World");
2.
we are copying a string without allocating memory to pointer . This is bug code .
correct solution :----
char *string()
{
char *text[20];
text[0]=malloc(20*sizeof (char));
strcpy(text,"Hello world");
return text;
}  |
| Avinash |
| |
| |
| Answer | as for as i know , there is only one error..... you have
declared text as array of pointers and not as character data
array..... so this text can only accept addresses.... :)
char *text[20] means you are going to store 20 addresses in
this array..... When you store addresses using arrays , the
that is called array of pointers....
if u declare : char text[20] , this will work correctly..
thank u  |
| Vignesh1988i |
| |
| |
| Question |
write a c program to find biggest of 3 number without
relational operator? |
Rank |
Answer Posted By |
|
Question Submitted By :: Guest |
| This Interview Question Asked @ Wipro |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | void main()
{
int a = 5;
int b = 7;
int c = 2;
int res;
res = (int)(a/b)?a:b;
res = (int)(res/c)?res:c;
printf("big num = %d",res);
}  |
| Manjeeth |
| |
| |
| Answer | #include<stdio.h>
#include<conio.h>
void main()
int a,b,c;
clrscr();
printf("enter any three no.s");
scanf("%d%d%d",&a,&b&c);
if(a>b&&a>c);
{
printf("a is biggest");
}
else if(b>a&&b>c)
{
printf("b is biggest");
}
else
printf("c is biggest");
getch();
}  |
| Priyanka |
| |
| |
|
| |
|
Back to Questions Page |