| Other C Code Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| main()
{
char a[4]="HELLO";
printf("%s",a);
} | | 1 |
| void main()
{
while(1){
if(printf("%d",printf("%d")))
break;
else
continue;
}
} | | 1 |
| main()
{
int i;
i = abc();
printf("%d",i);
}
abc()
{
_AX = 1000;
} | | 1 |
| #define clrscr() 100
main()
{
clrscr();
printf("%d\n",clrscr());
} | | 1 |
| main()
{
char str1[] = {s,o,m,e};
char str2[] = {s,o,m,e,\0};
while (strcmp(str1,str2))
printf(Strings are not equal\n);
} | | 1 |
| main()
{
char *p="GOOD";
char a[ ]="GOOD";
printf("\n sizeof(p) = %d, sizeof(*p) = %d, strlen(p) = %d",
sizeof(p), sizeof(*p), strlen(p));
printf("\n sizeof(a) = %d, strlen(a) = %d",
sizeof(a), strlen(a));
} | | 1 |
| how to return a multiple value from a function? | Wipro | 5 |
| #include<stdio.h>
main()
{
register i=5;
char j[]= "hello";
printf("%s %d",j,i);
} | | 1 |
| main()
{
int i = 257;
int *iPtr = &i;
printf("%d %d", *((char*)iPtr), *((char*)iPtr+1) );
} | | 1 |
| main()
{
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 |
| main( )
{
int a[ ] = {10,20,30,40,50},j,*p;
for(j=0; j<5; j++)
{
printf(%d ,*a);
a++;
}
p = a;
for(j=0; j<5; j++)
{
printf(%d ,*p);
p++;
}
} | | 1 |
| program to find the roots of a quadratic equation | HP | 3 |
| main()
{
int i=5;
printf(%d,i=++i ==6);
} | | 1 |
| typedef struct error{int warning, error, exception;}error;
main()
{
error g1;
g1.error =1;
printf("%d",g1.error);
} | | 1 |
| Write a routine that prints out a 2-D array in spiral order | Microsoft | 2 |
| void main()
{
int i=5;
printf("%d",i++ + ++i);
} | | 1 |
| What are segment and offset addresses? | Infosys | 1 |
| How we print the table of 3 using for loop in c
programing? | | 3 |
| main()
{
char * strA;
char * strB = I am OK;
memcpy( strA, strB, 6);
}
a. Runtime error.
b. I am OK
c. Compile error
d. I am O | HCL | 2 |
| #define prod(a,b) a*b
main()
{
int x=3,y=4;
printf("%d",prod(x+2,y-1));
} | | 1 |
| |
| For more C Code Interview Questions Click Here |