| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| what is use of loop? | Infosys | 6 |
| WRITE A PROGRAM IN C TO MULTIPLY TWO 2-D ARRAYS | | 4 |
| what is the difference between const volatile int i
& volatile const int j; | HCL | 2 |
| 1.write a program to merge the arrays
2.write efficient code for extracting unique elements from a
sorted list of array? | Qualcomm | 2 |
| write a program that explain #define and # undef directive | | 1 |
| Unsigned char c;
for ( c=0;c!=256;c++2)
printf("%d",c);
No. of times the loop is executed ?
| Mascot | 3 |
| main()
{
float a=3.2e40;
printf("%d",a);
} | Satyam | 5 |
| what is the diff b/w static and non static variables in C.
Give some examples plz. | Wipro | 2 |
| Write code for finding depth of tree | Adobe | 1 |
| What kind of sorting is this?
SORT (k,n)
1.[Loop on I Index]
repeat thru step2 for i=1,2,........n-1
2.[For each pass,get small value]
min=i;
repeat for j=i+1 to N do
{
if K[j]<k[min]
min=j;
}
temp=K[i];K[i]=K[min];K[min]=temp;
3.[Sorted Values will be returned]
A)Bubble Sort
B)Quick Sort
C)Selection Sort
D)Merge Sort | Accenture | 3 |
| explain memory layout of a C program | | 1 |
| write a Program to dispaly upto 100 prime numbers(without
using Arrays,Pointer) | Wipro | 7 |
| what is meant by c | | 4 |
| Write an implementation of float stringToFloat(char *str).
The code should be simple, and not require more than the
basic operators (if, for, math operators, etc.).
Assumptions
Dont worry about overflow or underflow
Stop at the 1st invalid character and return the number
you have converted till then, if the 1st character is
invalid return 0
Dont worry about exponential (e.g. 1e10), instead you
should treat e as an invalid character
Write it like real code, e.g. do error checking
Go though the string only once
Examples
1.23 should return 1.23
1a should return 1
ashould return 0
| Qualcomm | 5 |
| pointer_variable=(typecasting
datatype*)malloc(sizeof(datatype));
This is the syntax for malloc?Please explain this,how it
work with an example? | Excel | 2 |
| Implement a function that returns the 5th element from the
end in a singly linked list of integers in one pass. | Microsoft | 6 |
| void main()
{
int s[4][2]={ {1234,56},{1212,33},{1434,80},{1312,78} };
int (*p)[2];
int i,j,*pint;
for(i=0;i<=3;i++)
{
p=&s[i];
pint=p;
printf("\n");
for(j=0;j<=1;j++)
printf("%d",*(pint+j));
}
} while running this program it shows a warning-suspicious
pointer conversion ie pint=p; my que is why should we assign
the value of p to pint again.why cant we use it directly as
*(p+j)..but if i use like tat the o/p is garbage value.. | | 1 |
| Write a program that accepts a string where multiple spaces
are given in between the words. Print the string ignoring
the multiple spaces.
Example:
Input: We.....Are....Student Note: one .=1 Space
Output: "We Are Student" | IBM | 4 |
| C,c++, Java is all are structural oriented or procedure
oriented language..? | | 3 |
| Given an array of numbers, except for one number all the
others occur twice. Give an algorithm to find that number
which occurs only once in the array. | | 4 |
| |
| For more C Interview Questions Click Here |