| Other C Code Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| 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. | Wipro | 2 |
| write a program to count the number the same
(letter/character foreg: 's') in a given sentence. | | 1 |
| #include<stdio.h>
main()
{
const int i=4;
float j;
j = ++i;
printf("%d %f", i,++j);
} | | 1 |
| Write a function to find the depth of a binary tree. | Adobe | 8 |
| What is the output for the following program
main()
{
int arr2D[3][3];
printf("%d\n", ((arr2D==* arr2D)&&(* arr2D ==
arr2D[0])) );
} | | 1 |
| print a semicolon using Cprogram without using a semicolon
any where in the C code in ur program!!
| Tata-Elxsi | 19 |
| Is the following statement a declaration/definition. Find
what does it mean?
int (*x)[10]; | | 1 |
| main()
{
int i=300;
char *ptr = &i;
*++ptr=2;
printf("%d",i);
} | | 1 |
| main()
{
int i;
printf("%d",scanf("%d",&i)); // value 10 is given as
input here
} | | 1 |
| Write out a function that prints out all the permutations of
a string.
For example, abc would give you abc, acb, bac, bca, cab,
cba. You can assume that all the characters will be unique. | Microsoft | 4 |
| enum colors {BLACK,BLUE,GREEN}
main()
{
printf("%d..%d..%d",BLACK,BLUE,GREEN);
return(1);
} | | 1 |
| What are the files which are automatically opened when a C
file is executed? | | 1 |
| String reverse with time complexity of n/2 with out using
temporary variable. | NetApp | 8 |
| main()
{
float i=1.5;
switch(i)
{
case 1: printf("1");
case 2: printf("2");
default : printf("0");
}
} | | 1 |
| void ( * abc( int, void ( *def) () ) ) (); | | 1 |
| void main()
{
if(~0 == (unsigned int)-1)
printf(“You can answer this if you know how values are
represented in memory”);
} | | 1 |
| main()
{
int i, n;
char *x = “girl”;
n = strlen(x);
*x = x[n];
for(i=0; i<n; ++i)
{
printf(“%s\n”,x);
x++;
}
} | | 1 |
| main()
{
while (strcmp(“some”,”some\0”))
printf(“Strings are not equal\n”);
} | | 1 |
| How to access command-line arguments? | | 4 |
| 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 |
| |
| For more C Code Interview Questions Click Here |