| Other C Code Interview Questions |
| | | Question | Asked @ | Answers | | | | void main ()
{
int x = 10;
printf ("x = %d, y = %d", x,--x++);
}
a. 10, 10
b. 10, 9
c. 10, 11
d. none of the above | HCL | 1 | | typedef struct error{int warning, error, exception;}error;
main()
{
error g1;
g1.error =1;
printf("%d",g1.error);
} | | 1 | | #define prod(a,b) a*b
main()
{
int x=3,y=4;
printf("%d",prod(x+2,y-1));
} | | 1 | | Printf can be implemented by using __________ list. | | 1 | | main()
{
int i;
clrscr();
printf("%d", &i)+1;
scanf("%d", i)-1;
}
a. Runtime error.
b. Runtime error. Access violation.
c. Compile error. Illegal syntax
d. None of the above | HCL | 1 | | main()
{
void swap();
int x=10,y=8;
swap(&x,&y);
printf("x=%d y=%d",x,y);
}
void swap(int *a, int *b)
{
*a ^= *b, *b ^= *a, *a ^= *b;
} | | 1 | | main()
{
char *p;
p="%d\n";
p++;
p++;
printf(p-2,300);
} | | 1 | | struct point
{
int x;
int y;
};
struct point origin,*pp;
main()
{
pp=&origin;
printf("origin is(%d%d)\n",(*pp).x,(*pp).y);
printf("origin is (%d%d)\n",pp->x,pp->y);
} | | 1 | | main()
{
clrscr();
}
clrscr(); | | 1 | | Given only putchar (no sprintf, itoa, etc.) write a routine
putlong that prints out an unsigned long in decimal. | | 5 | | main()
{
int i, j;
scanf("%d %d"+scanf("%d %d", &i, &j));
printf("%d %d", i, j);
}
a. Runtime error.
b. 0, 0
c. Compile error
d. the first two values entered by the user | HCL | 1 | | How we print the table of 3 using for loop in c
programing? | | 3 | | # include <stdio.h>
int one_d[]={1,2,3};
main()
{
int *ptr;
ptr=one_d;
ptr+=3;
printf("%d",*ptr);
} | | 1 | | How we will connect multiple client ? (without using
fork,thread) | TelDNA | 2 | | int swap(int *a,int *b)
{
*a=*a+*b;*b=*a-*b;*a=*a-*b;
}
main()
{
int x=10,y=20;
swap(&x,&y);
printf("x= %d y = %d\n",x,y);
} | | 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 | | main()
{
int i=300;
char *ptr = &i;
*++ptr=2;
printf("%d",i);
} | | 1 | | main()
{
unsigned char i=0;
for(;i>=0;i++) ;
printf("%d\n",i);
} | | 1 | | void main()
{
int i=i++,j=j++,k=k++;
printf(“%d%d%d”,i,j,k);
} | | 1 | | main()
{
int i=-1;
+i;
printf("i = %d, +i = %d \n",i,+i);
} | | 1 | | | | For more C Code Interview Questions Click Here |
|