| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| What are the preprocessors? | HP | 6 |
| write the function int countchtr(char string[],int
ch);which returns the number of timesthe character ch
appears in the string. for example the call countchtr("she
lives in Newyork",'e') would return 3. | | 4 |
| What is encapsulation? | | 1 |
| Tell us the difference between these two :
#include"stdio.h"
#include<stdio.h>
define in detial. | | 4 |
| what is the difference between NULL & NUL keywords in C? | | 3 |
| WRITE A C PROGRAM TO FIND SECOND BIGGEST VALUE FROM THE
GIVEN VALUES | | 1 |
| main()
{
int i = 1;
int num[] = {1,2,3,4};
num[i] = i++;
printf("%d", num[i]);
}
what will be the output?
} | NDS | 15 |
| enum colors {BLACK,BLUE,GREEN}
main()
{
printf("%d..%d..%d",BLACK,BLUE,GREEN);
return(1);
}
| ME | 3 |
| Which of the following are valid "include" formats?
A)#include and #include[file.h]
B)#include (file.h) and #include
C)#include [file.h] and #include "file.h"
D)#include <file.h> and #include "file.h"
| Accenture | 14 |
| how to find the size of the data type like int,float
without using the sizeof operator? | | 7 |
| int *p=20;
if u print like dis printf("%d",p);
o\p:- 20; how is it possible?
plz give me the explanation. | Global-Edge | 11 |
| what will happen if you free a pointer twice after
allocating memory dynamically ? | Novell | 2 |
| 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 | 4 |
| what is the output of the following program?
main()
{
int c[]={2,8,3,4,4,6,7,5};
int j,*p=c,*q=c;
for(j=0;j<5;j++)
{
printf("%d",*c);
++q;
}
for(j=0;j<5;j++)
{
printf("%d",*p);
++p;
}
} | | 4 |
| write a program to find out number of on bits in a number?
| Huawei | 12 |
| How can I invoke another program from within a C program? | | 6 |
| what are the static variables
| HCL | 7 |
| what is the difference between #include<> and #include”…”? | | 1 |
| How can I implement opaque (abstract) data types in C?
What's the difference between these two declarations?
struct x1 { ... };
typedef struct { ... } x2;
| | 2 |
| why division operator not work in case of float constant? | | 1 |
| |
| For more C Interview Questions Click Here |