| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| write a Program to dispaly upto 100 prime numbers(without
using Arrays,Pointer) | Wipro | 5 |
| 1,4,8,13,21,30,36,45,54,63,73,?,?. | Franklin-Templeton | 3 |
| what is volatile in c language? | TCS | 1 |
| what's the o/p
int main(int n, char *argv[])
{
char *s= *++argv;
puts(s);
exit(0);
}
| Motorola | 1 |
| How many ways are there to swap two numbers without using
temporary variable? Give the each logic. | | 4 |
| main()
{
char *ptr = "Ramco Systems";
(*ptr)++;
printf("%s\n",ptr);
ptr++;
printf("%s\n",ptr);
}
Find the Outputs? | CitiGroup | 5 |
| Write a C function to search a number in the given list of
numbers. donot use printf and scanf | Honeywell | 6 |
| what is the return value (status code) of exit() function....
what the arguments(integer value) passed to it means.... | TCS | 1 |
| what does the following code do?
fn(int n,int p,int r)
{
static int a=p;
switch(n){
case 4:a+=a*r;
case 3:a+=a*r;
case 2:a+=a*r;
case 1:a+=a*r;
}
}
a.computes simple interest for one year
b.computes amount on compound interest for 1 to 4 years
c.computes simple interest for four year
d.computes compound interst for 1 year
| TCS | 3 |
| What is the output for the following program
#include<stdio.h>
main()
{
char a[5][5],flag;
a[0][0]='A';
flag=((a==*a)&&(*a==a[0]));
printf("%d\n",flag);
}
| ADITI | 3 |
| declare afunction pointer to int printf(char *)? | HCL | 1 |
| print the following using nested for loop.
5 4 3 2 1
1 2 3 4
3 2 1
1 2
1
2 1
1 2 3
4 3 2 1
1 2 3 4 5 | | 4 |
| What is the function of ceil(X) defined in math.h do?
A)It returns the value rounded down to the next lower
integer
B)it returns the value rounded up to the next higher integer
C)the Next Higher Value
D)the next lower value | Accenture | 3 |
| How do I initialize a pointer to a function? | | 2 |
| difference between memcpy and strcpy | | 1 |
| AMMONG THE 4 STROAGE CLASSES IN C, WHICH ONE FASTEST? | HCL | 9 |
| what is y value of the code if input x=10
y=5;
if (x==10)
else if(x==9)
elae y=8;
a.9
b.8
c.6
d.7
| TCS | 1 |
| 1.what are local and global variables?
2.what is the scope of static variables?
3.what is the difference between static and global variables?
4.what are volatile variables?
5.what is the use of 'auto' keyword?
6.how do we make a global variable accessible across files?
Explain the extern keyword?
7.what is a function prototype?
8.what does keyword 'extern' mean in a function declaration?
| | 1 |
| how to find the size of the data type like int,float
without using the sizeof operator? | | 5 |
| what does the following function print?
func(int i)
{
if(i%2)return 0;
eale return 1;
}
main()
{
int =3;
i=func(i);
i=func(i);
printf("%d",i);}
| TCS | 8 |
| |
| For more C Interview Questions Click Here |