| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| f(*p)
{
p=(char *)malloc(6);
p="hello";
return;
}
main()
{
char *p="bye";
f(p);
printf("%s",p);
}
what is the o/p?
| Hughes | 4 |
| Is the following code legal?
struct a
{
int x;
struct a b;
}
| | 3 |
| HOW TO ANSWER IF ASKED " WHAT KIND OF A PERSON ARE YOU?" I
NEED AN ANSWER THAT IMPRESS THE INTERVIEWER | | 2 |
| int *a[5] refers to | TCS | 8 |
| #include<stdio.h>
main()
{
char s1[]="Ramco";
char s2[]="Systems";
s1=s2;
printf("%s",s1);
}
what will happen if you executed this code? | Ramco | 4 |
| How to add two numbers with using function?
| | 3 |
| compute the nth mumber in the fibonacci sequence? | TCS | 7 |
| what is array? | HCL | 22 |
| how to make c program without a libary?
e.g.#include<stdio.h> libary is not in c progaram. | | 1 |
| what is the output of the following program?
#include<stdio.h>
void main()
{
float x=1.1;
while(x==1.1)
{
printf("\n%f",x);
x=x-0.1;
}
} | | 4 |
| write a program for even numbers? | | 8 |
| enum colors {BLACK,BLUE,GREEN}
main()
{
printf("%d..%d..%d",BLACK,BLUE,GREEN);
return(1);
}
| ME | 3 |
| what is the difference between. system call and library
function? | CDAC | 2 |
| How can we see the Expanded source code and compiled code
for our source program in C? | | 1 |
|
#include<stdio.h>
int SumElement(int *,int);
void main(void)
{
int x[10];
int i=10;
for(;i;)
{
i--;
*(x+i)=i;
}
printf("%d",SumElement(x,10));
}
int SumElement(int array[],int size)
{
int i=0;
float sum=0;
for(;i<size;i++)
sum+=array[i];
return sum;
}
output? | Ramco | 5 |
| How to add two numbers without using arithmetic operators? | Sapient | 11 |
| Tell about strtok & strstr functions | Motorola | 2 |
| Print all numbers which has a certain digit in a certain
position
eg:
number=45687
1 number=4
2 number=5
etc | | 2 |
| what is link list?
| | 2 |
| 4.A function 'q' that accepts a pointer to a character as
argument and returns a pointer to an array of integer can
be declared as:
A)int (*q(char*)) []
B)int *q(char*) []
C)int(*q)(char*) []
D)None of the Above
| Accenture | 4 |
| |
| For more C Interview Questions Click Here |