| Other C Code Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| main()
{
int a[10];
printf("%d",*a+1-*a+3);
} | | 1 |
| main()
{
float f=5,g=10;
enum{i=10,j=20,k=50};
printf("%d\n",++k);
printf("%f\n",f<<2);
printf("%lf\n",f%g);
printf("%lf\n",fmod(f,g));
} | | 1 |
| main()
{
unsigned char i=0;
for(;i>=0;i++) ;
printf("%d\n",i);
} | | 1 |
| How will u find whether a linked list has a loop or not? | Microsoft | 6 |
| void main()
{
static int i=i++, j=j++, k=k++;
printf(“i = %d j = %d k = %d”, i, j, k);
} | | 1 |
| main( )
{
static int a[ ] = {0,1,2,3,4};
int *p[ ] = {a,a+1,a+2,a+3,a+4};
int **ptr = p;
ptr++;
printf(“\n %d %d %d”, ptr-p, *ptr-a, **ptr);
*ptr++;
printf(“\n %d %d %d”, ptr-p, *ptr-a, **ptr);
*++ptr;
printf(“\n %d %d %d”, ptr-p, *ptr-a, **ptr);
++*ptr;
printf(“\n %d %d %d”, ptr-p, *ptr-a, **ptr);
} | | 1 |
| 1)
int i=5;
j=i++ + i++ + i++;
printf("%d",j);This code gives the answer 15.But if we
replace the value of the j then anser is different?why?
2)int i=5;
printf("%d",i++ + i++ + i++);
this givs 18. | Infosys | 6 |
| You are given any character string. Find the number of sets
of vowels that come in the order of aeiou in the given
string. For eg., let the given string be DIPLOMATIC. The
answer returned must be "The number of sets is 2" and "The
sets are "IO and AI". Vowels that form a singleton set must
be neglected. Try to post the program executable in gcc or
g++ or in java. | | 3 |
| print a semicolon using Cprogram without using a semicolon
any where in the C code in ur program!!
| Tata-Elxsi | 19 |
| main(int argc, char **argv)
{
printf("enter the character");
getchar();
sum(argv[1],argv[2]);
}
sum(num1,num2)
int num1,num2;
{
return num1+num2;
} | | 1 |
| 1
o 1
1 0 1
0 1 0 1
1 0 1 0 1
how to design this function format in c-language ? | | 1 |
| void main()
{
int i=5;
printf("%d",i+++++i);
} | | 1 |
| Is the following statement a declaration/definition. Find
what does it mean?
int (*x)[10]; | | 1 |
| main()
{
clrscr();
}
clrscr(); | | 1 |
| What are the following notations of defining functions known as?
i. int abc(int a,float b)
{
/* some code */
}
ii. int abc(a,b)
int a; float b;
{
/* some code*/
} | | 1 |
| plz send me all data structure related programs | | 2 |
| #include<conio.h>
main()
{
int x,y=2,z,a;
if(x=y%2) z=2;
a=2;
printf("%d %d ",z,x);
} | | 1 |
| How to access command-line arguments? | | 4 |
| #include<stdio.h>
main()
{
struct xx
{
int x;
struct yy
{
char s;
struct xx *p;
};
struct yy *q;
};
} | | 1 |
| main()
{
char a[4]="HELL";
printf("%s",a);
} | Wipro | 1 |
| |
| For more C Code Interview Questions Click Here |