| Other C Code Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| Program to find the largest sum of contiguous integers in
the array. O(n) | | 7 |
| main()
{
main();
} | | 1 |
| main()
{
struct date;
struct student
{
char name[30];
struct date dob;
}stud;
struct date
{
int day,month,year;
};
scanf("%s%d%d%d", stud.rollno, &student.dob.day,
&student.dob.month, &student.dob.year);
} | | 1 |
| Declare an array of N pointers to functions returning
pointers to functions returning pointers to characters? | | 1 |
| void main()
{
static int i=i++, j=j++, k=k++;
printf(“i = %d j = %d k = %d”, i, j, k);
} | | 1 |
| main()
{
char *cptr,c;
void *vptr,v;
c=10; v=0;
cptr=&c; vptr=&v;
printf("%c%v",c,v);
} | | 1 |
| write the function. if all the character in string B appear in
string A, return true, otherwise return false. | Google | 10 |
| main()
{
extern i;
printf("%d\n",i);
{
int i=20;
printf("%d\n",i);
}
} | | 1 |
| Write a C function to search a number in the given list of
numbers. donot use printf and scanf | Honeywell | 4 |
| main()
{
register int a=2;
printf("Address of a = %d",&a);
printf("Value of a = %d",a);
} | | 1 |
| To Write a C program to remove the repeated characters in
the entered expression or in entered characters(i.e)
removing duplicates. | Synergy | 2 |
| Program to Delete an element from a doubly linked list.
| Infosys | 4 |
| main()
{
int x=5;
clrscr();
for(;x<= 0;x--)
{
printf("x=%d ", x--);
}
}
a. 5, 3, 1
b. 5, 2, 1,
c. 5, 3, 1, -1, 3
d. –3, -1, 1, 3, 5 | HCL | 1 |
| main()
{
int *j;
{
int i=10;
j=&i;
}
printf("%d",*j);
} | | 1 |
| Write a prog to accept a given string in any order and flash
error if any of the character is different.
For example : If abc is the input then abc, bca, cba, cab
bac are acceptable, but aac or bcd are unacceptable. | Microsoft | 5 |
| main()
{
int c = 5;
printf("%d", main||c);
}
a. 1
b. 5
c. 0
d. none of the above | HCL | 1 |
| Is there any difference between the two declarations,
1. int foo(int *arr[]) and
2. int foo(int *arr[2]) | | 1 |
| write a program in c to merge two array | | 1 |
| main()
{
int i=3;
switch(i)
{
default:printf("zero");
case 1: printf("one");
break;
case 2:printf("two");
break;
case 3: printf("three");
break;
}
} | | 1 |
| #include<stdio.h>
main()
{
int a[2][2][2] = { {10,2,3,4}, {5,6,7,8} };
int *p,*q;
p=&a[2][2][2];
*q=***a;
printf("%d..%d",*p,*q);
} | | 1 |
| |
| For more C Code Interview Questions Click Here |