| Other C Code Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| print numbers till we want without using loops or condition
statements like specifically(for,do while, while swiches,
if etc)!
| Wipro | 8 |
| main()
{
int i=0;
for(;i++;printf("%d",i)) ;
printf("%d",i);
} | | 1 |
| main ( )
{
static char *s[ ] = {“black”, “white”, “yellow”,
“violet”};
char **ptr[ ] = {s+3, s+2, s+1, s}, ***p;
p = ptr;
**++p;
printf(“%s”,*--*++p + 3);
} | | 1 |
| #define clrscr() 100
main()
{
clrscr();
printf("%d\n",clrscr());
} | | 1 |
| # include <stdio.h>
int one_d[]={1,2,3};
main()
{
int *ptr;
ptr=one_d;
ptr+=3;
printf("%d",*ptr);
} | | 1 |
| main()
{
static int var = 5;
printf("%d ",var--);
if(var)
main();
} | | 1 |
| Write a procedure to implement highlight as a blinking
operation | | 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()
{
printf("%x",-1<<4);
} | | 1 |
| Given an array of characters which form a sentence of
words, give an efficient algorithm to reverse the order of
the words (not characters) in it.
| Microsoft | 7 |
| write a program to count the number the same
(letter/character foreg: 's') in a given sentence. | | 2 |
| Finding a number multiplication of 8 with out using
arithmetic operator | NetApp | 8 |
| how many processes will gate created execution of
--------
fork();
fork();
fork();
--------
Please Explain...
Thanks in advance..! | GATE | 3 |
| void main()
{
static int i=5;
if(--i){
main();
printf("%d ",i);
}
} | | 1 |
| main()
{
float i=1.5;
switch(i)
{
case 1: printf("1");
case 2: printf("2");
default : printf("0");
}
} | | 1 |
| Given an array of size N in which every number is between 1
and N, determine if there are any duplicates in it. You are
allowed to destroy the array if you like. | Microsoft | 16 |
| main()
{
int i=5;
printf("%d",++i++);
} | | 1 |
| String copy logic in one line. | NetApp | 10 |
| 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()
{
int c = 5;
printf("%d", main||c);
}
a. 1
b. 5
c. 0
d. none of the above | HCL | 1 |
| |
| For more C Code Interview Questions Click Here |