| Other C Code Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| Given a list of numbers ( fixed list) Now given any other
list, how can you efficiently find out if there is any
element in the second list that is an element of the
first list (fixed list) | Disney | 3 |
| Write a procedure to implement highlight as a blinking
operation | | 1 |
| How do I write a program to print proper subset of given
string . Eg :input: abc
output:{},{a},{b},{c},{a,b},{a,c},{b,c},
{a,b,c}.I desperately need this program please mail me to
saravana6m@gmail.com | Deshaw | 9 |
| 1. const char *a;
2. char* const a;
3. char const *a;
-Differentiate the above declarations. | | 2 |
| Write a C function to search a number in the given list of
numbers. donot use printf and scanf | Honeywell | 4 |
| #define clrscr() 100
main()
{
clrscr();
printf("%d\n",clrscr());
} | | 1 |
| What is "far" and "near" pointers in "c"...? | | 3 |
| Declare an array of N pointers to functions returning
pointers to functions returning pointers to characters? | | 1 |
| How will you print % character?
a. printf(“\%”)
b. printf(“\\%”)
c. printf(“%%”)
d. printf(“\%%”) | HCL | 1 |
| main()
{
char *a = "Hello ";
char *b = "World";
clrscr();
printf("%s", strcat(a,b));
}
a. Hello
b. Hello World
c. HelloWorld
d. None of the above | HCL | 1 |
| struct Foo
{
char *pName;
char *pAddress;
};
main()
{
struct Foo *obj = malloc(sizeof(struct Foo));
clrscr();
obj->pName = malloc(100);
obj->pAddress = malloc(100);
strcpy(obj->pName,"Your Name");
strcpy(obj->pAddress, "Your Address");
free(obj);
printf("%s", obj->pName);
printf("%s", obj->pAddress);
}
a. Your Name, Your Address
b. Your Address, Your Address
c. Your Name Your Name
d. None of the above | HCL | 1 |
| #include<stdio.h>
main()
{
char s[]={'a','b','c','\n','c','\0'};
char *p,*str,*str1;
p=&s[3];
str=p;
str1=s;
printf("%d",++*p + ++*str1-32);
} | | 1 |
| main()
{
signed int bit=512, i=5;
for(;i;i--)
{
printf("%d\n", bit = (bit >> (i - (i -1))));
}
}
a. 512, 256, 128, 64, 32
b. 256, 128, 64, 32, 16
c. 128, 64, 32, 16, 8
d. 64, 32, 16, 8, 4 | HCL | 1 |
| Derive expression for converting RGB color parameters to
HSV values | | 1 |
| main()
{
int i;
i = abc();
printf("%d",i);
}
abc()
{
_AX = 1000;
} | | 1 |
| main()
{
int i =0;j=0;
if(i && j++)
printf("%d..%d",i++,j);
printf("%d..%d,i,j);
} | | 1 |
| main()
{
char *a = "Hello ";
char *b = "World";
clrscr();
printf("%s", strcpy(a,b));
}
a. “Hello”
b. “Hello World”
c. “HelloWorld”
d. None of the above | HCL | 1 |
| Sorting entire link list using selection sort and insertion
sort and calculating their time complexity | NetApp | 1 |
| #define SQR(x) x * x
main()
{
printf("%d", 225/SQR(15));
}
a. 1
b. 225
c. 15
d. none of the above | HCL | 1 |
| #include<stdio.h>
main()
{
FILE *ptr;
char i;
ptr=fopen("zzz.c","r");
while((i=fgetch(ptr))!=EOF)
printf("%c",i);
} | | 1 |
| |
| For more C Code Interview Questions Click Here |