| Other C Code Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| main()
{
unsigned int i=10;
while(i-->=0)
printf("%u ",i);
} | | 1 |
| how to check whether a linked list is circular. | | 3 |
| main()
{
int c = 5;
printf("%d", main||c);
}
a. 1
b. 5
c. 0
d. none of the above | HCL | 1 |
| char *someFun1()
{
char temp[ ] = “string";
return temp;
}
char *someFun2()
{
char temp[ ] = {‘s’, ‘t’,’r’,’i’,’n’,’g’};
return temp;
}
int main()
{
puts(someFun1());
puts(someFun2());
} | | 1 |
| main()
{
show();
}
void show()
{
printf("I'm the greatest");
} | | 1 |
| main()
{
int a[10];
printf("%d",*a+1-*a+3);
} | | 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 |
| main()
{
static int var = 5;
printf("%d ",var--);
if(var)
main();
} | | 1 |
| main()
{
char *p;
p="Hello";
printf("%c\n",*&*p);
} | | 1 |
| There were 10 records stored in “somefile.dat” but the
following program printed 11 names. What went wrong?
void main()
{
struct student
{
char name[30], rollno[6];
}stud;
FILE *fp = fopen(“somefile.dat”,”r”);
while(!feof(fp))
{
fread(&stud, sizeof(stud), 1 , fp);
puts(stud.name);
}
} | | 1 |
| #define clrscr() 100
main()
{
clrscr();
printf("%d\n",clrscr());
} | | 1 |
| How we print the table of 3 using for loop in c
programing? | | 3 |
| main()
{
int i=5,j=6,z;
printf("%d",i+++j);
} | | 1 |
| In the following pgm add a stmt in the function fun such
that the address of
'a' gets stored in 'j'.
main(){
int * j;
void fun(int **);
fun(&j);
}
void fun(int **k) {
int a =0;
/* add a stmt here*/
} | | 1 |
| #include<stdio.h>
main()
{
struct xx
{
int x;
struct yy
{
char s;
struct xx *p;
};
struct yy *q;
};
} | | 1 |
| Write a procedure to implement highlight as a blinking
operation | | 1 |
| Sorting entire link list using selection sort and insertion
sort and calculating their time complexity | NetApp | 1 |
| void main()
{
while(1){
if(printf("%d",printf("%d")))
break;
else
continue;
}
} | | 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 |
| int i=10;
main()
{
extern int i;
{
int i=20;
{
const volatile unsigned i=30;
printf("%d",i);
}
printf("%d",i);
}
printf("%d",i);
} | | 1 |
| |
| For more C Code Interview Questions Click Here |