| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| How do I declare a pointer to an array? | | 5 |
| Struct(s)
{
int a;
long b;
}
Union (u)
{int a;
long b;
}
Print sizeof(s)and sizeof(u) if sizeof(int)=4 and
sizeof(long)=4
| Mascot | 2 |
| What are Storage Classes in C ? | HP | 6 |
| write a program to insert an element at the specified
position in the given array in c language | | 1 |
| define function | Assurgent | 4 |
| without a terminator how can we print a message in a printf
() function. | NIIT | 3 |
| 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 |
| write a program to find the number of even integers and odd
integers in a given array in c language | Olive-Tech | 2 |
| macros and function are related in what aspect?
a)recursion b)varying no of arguments
c)hypochecking d)type declaration
| HCL | 7 |
| what is differnence b/w macro & functions | | 1 |
| Who is invented by c? | Infosys | 12 |
| wats the diference btwen constant pointer and pointer to a
constant.pls give examples. | | 4 |
| Explain the differences between public, protected, private
and internal. | | 1 |
| write a program for even numbers? | | 6 |
| 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 | 12 |
| consider the following structure:
struct num nam{
int no;
char name[25];
};
struct num nam
n1[]={{12,"Fred"},{15,"Martin"},{8,"Peter"},{11,Nicholas"}};
.....
.....
printf("%d%d",n1[2],no,(*(n1 + 2),no) + 1);
What does the above statement print?
a.8,9
b.9,9
c.8,8
d.8,unpredictable value
| TCS | 2 |
| 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 |
| to find the program of matrix multiplication using arrays | | 1 |
| regarding the scope of the varibles;identify the incorrect
statement:
a.automatic variables are automatically initialised to 0
b.static variables are are automatically initialised to 0
c.the address of a register variable is not accessiable
d.static variables cannot be initialised with any expression
| TCS | 1 |
| How can I invoke another program from within a C program? | | 1 |
| |
| For more C Interview Questions Click Here |