| Other C Interview Questions |
| | | Question | Asked @ | Answers | | | | Write the program for displaying the ten most frequent words
in a file such that your program should be efficient in all
complexity measures. | Google | 3 | | what is the difference between #include<stdio.h> and
#include "stdio.h" ? | | 2 | | for(i=0;i=printf("Hello");i++);
printf("Hello");
how many times how will be printed????????? | | 4 | | 2)#include<iostream.h>
main()
{
printf("Hello World");
}
the program prints Hello World without changing main() the
o/p should
be
intialisation
Hello World
Desruct
the changes should be
a)iostream operator<<(iostream os, char*s)
os<<'intialisation'<<(Hello World)<<Destruct
b) c) d)none of the above | Siemens | 4 | | helllo sir ,
what is the main use of the pointer ,array ,and the
structure with the example of a programe | | 2 | | what is the use of using linked list and array? | Infosys | 9 | | Print all the palindrome numbers.If a number is not
palindrome make it one by attaching the reverse to it.
eg:123
output:123321 (or) 12321 | | 2 | | which one low Priority in c?
a)=,b)++,c)==,d)+ | | 8 | | dynamically allocate memory for linear array of n
integers,store some elements in it and find some of them | | 1 | | n=7623
{
temp=n/10;
result=temp*10+ result;
n=n/10
}
| Wipro | 4 | | What is difference between the following 2 lines….
int temp = (int)(0x00);
int temp = (0x00int);
| Bosch | 3 | | 44.what is the difference between strcpy() and memcpy()
function?
45.what is output of the following statetment?
46.Printf(“%x”, -1<<4); ?
47.will the program compile?
int i;
scanf(“%d”,i);
printf(“%d”,i);
48.write a string copy function routine?
49.swap two integer variables without using a third
temporary variable?
50.how do you redirect stdout value from a program to a file?
51.write a program that finds the factorial of a number
using recursion? | | 3 | | f()
{
int a=2;
f1(a++);
}
f1(int c)
{
printf("%d", c);
}
c=?
| Geometric-Software | 2 | | What's the difference between calloc() and malloc()? | | 3 | | How to avoid structure padding in C? | Tech-Mahindra | 4 | | WAP to convert text into its ASCII Code and also write a
function to decode the text given? | | 2 | | write a function to find whether a string is palindrome or
not and how many palindrome this string contain? | | 1 | | to find out the reverse digit of a given number | Infosys | 5 | | 1. Duplicate the even numbers. -1
Sample I/O
Array1:- 4,2,24,3,22
Updated Array:- 4,4,2,2,24,24,3,22,22
2. Reverse the array in a region - 1
Sample I/O
Array1:- 4,2,24,3,22,41,21
Enter Region:- 2,5
Update Array:-4,41,22,3,24,2,21
3. Store first the even digits in an array and then odd
digits in same array -2
Sample I/O
Array1:- 4,2,24,3,22,41,21
Array 2:- 4,2,2,4,2,2,4,2,3,1,1
4. Store the count of the digits in all numbers in an array
and print the count. -2
Sample I/O
Array1:- 4,2,9,3,7,41,28
Array 2:- 0,1,1,1,2,0,0,1,1,1
1-1;2-1;3-1;4-2;7-1;8-1;9-1
5. Store all palindrome numbers in to another array -2
Sample I/O
Array1:- 4,22,9,313,7,141,28
Array 2:- 4,22,9,313,141
6. Arrange the array in such a way that odd numbers come
first and then even numbers -1
Sample I/O
Array1:- 4,22,9,313,7,141,28
Update Array1:- 9,313,7,141,4,22,28
7. Store into another array by inserting it in the right
place - 2
Sample I/O
Array1:- 4,22,9,313,7,141,28
Array2:- 4 /4,22 /4,9,22 /4,9,22 ,313 /4,7,9,22 ,313
/4,7,9,22 ,141,313 /
4,7,9,22,28 ,141,313
8. Merge two sorted arrays in a sorted fashion - 3
Sample I/O
Array 1:- 3,6,7,9,11,16
Array 2:- 1,2,5,7,20
Array 3:- 1,2,3,5,6,7,9,11,16,20
9. Upadte the array so that an array element is followed by
its revere - 1
Sample I/O
Array 1:- 13,63,74,9,11,16
Updated Array 1:- 13,31,63,36,74,47,9,9,11,11,16,16
10.Spread the digits of the array in the same array. -1
Sample I/O
Array 1:- 13,63,74,9,11,16
Updated Array 1:-1,3,6,3,74,9,1,1,1,6
11.Shift the boundary of array to have only 2 digit numbers.
Sample I/O
Array 1:- 139,643,74,9,101,126
Updated Array 1:- 13,96,43,74,91,11,26
12.Print the largest occuring digit in an array of N numbers.
Sample I/O
Array 1:- 13,63,74,9,11,16
1 occurs most.
| Intel | 2 | | int zap(int n)
{
if(n<=1)then zap=1;
else zap=zap(n-3)+zap(n-1);
}
then the call zap(6) gives the values of zap
[a] 8 [b] 9 [c] 6 [d] 12 [e] 15
| Wipro | 8 | | | | For more C Interview Questions Click Here |
|