| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| difference between semaphores and mutex? | | 1 |
| write an interactive program to generate the divisors of a
given integer. | TCS | 4 |
| what is data structure
| | 4 |
| difference between i++* and *++i | IBM | 3 |
| DIFFERNCE BETWEEN THE C++ AND C LANGUAGE? | Wipro | 1 |
| what is the difference between normal variables and pointer
variables.............. | Satyam | 7 |
| What is the difference between static and global variables? | | 1 |
| What will be result of the following program?
void myalloc(char *x, int n)
{
x= (char *)malloc(n*sizeof(char));
memset(x,\0,n*sizeof(char));
}
main()
{
char *g="String";
myalloc(g,20);
strcpy(g,"Oldstring");
printf("The string is %s",g);
}
a) The string is : String
b) Run time error/Core dump
c) The string is : Oldstring
d) Syntax error during compilation
e) None of these
| IBM | 3 |
| Write a C program that computes the value ex by using the
formula
ex =1+x/1!+x2/2!+x3+3!+………….
| | 1 |
| how to find a 5th bit is set in c program | IBM | 3 |
| Why is conio.h not required when we save a file as .c and
use clrscr() or getch() ? | | 2 |
| In the following code segment what will be the result of the
function,
value of x , value of y
{
unsigned int x=-1;
int y;
y = ~0;
if(x == y)
printf("same");
else
printf("not same");
}
a) same, MAXINT, -1
b) not same, MAXINT, -MAXINT
c) same , MAXUNIT, -1
d) same, MAXUNIT, MAXUNIT
e) not same, MAXINT, MAXUNIT
| IBM | 1 |
| Reverse the part of the number which is present from
position i to j. Print the new number.[without using the array]
eg:
num=789876
i=2
j=5
778986 | | 2 |
| Who is invented by c? | Infosys | 14 |
| write a own function for strstr | LG-Soft | 1 |
| a.One Cannot Take the address of a Bit Field
b.bit fields cannot be arrayed
c.Bit-Fields are machine Dependant
d.Bit-fields cannot be declared as static
Which of the Following Statements are true w.r.t Bit-Fields
A)a,b&c B)Only a & b C)Only c D)All
| Accenture | 2 |
| How can I allocate arrays or structures bigger than 64K? | | 4 |
| 52.write a “Hello World” program in “c” without using a
semicolon?
53.Give a method to count the number of ones in a 32 bit number?
54.write a program that print itself even if the source file
is deleted?
55.Given an unsigned integer, find if the number is power of 2? | | 5 |
| What is difference between the following 2 lines….
int temp = (int)(0x00);
int temp = (0x00int);
| Bosch | 3 |
| Write code for initializing one dimentional and two
dimentional array in a C Program? | Deshaw | 5 |
| |
| For more C Interview Questions Click Here |