You are on page 1of 2

C Interview QuestionsSorting Options :

What is the difference between structure & union?how can we multiply this
A*B without using "*" operator? Latest Answer: A structure's elements are all
distinct, without overlap:struct x{ char x; int y; long z;};You can modify
x or y or z without affecting the values of the others; they each have their
own ...Read Answers (6) | Asked by : sathishkumar

Answer Question Subscribe

How to write a sizeof function using a macro function?Latest Answer: Hi Siva,


This would be the correct, #include#define mySizeof(x)
(mySizeof1(x))#define mySizeof1(x){__typeof__(x) tmp ;(char*)(&tmp + 1) -
(char*)(&tmp);}main(){int a;printf("size ...Read Answers (4) | Asked by :
mani2881

Answer Question Subscribe

C program to count numbers of positive and negative numbers Write a C


program using arrays to count the numbers of positive and negative numbers
which accepts the inputs as "size of the array" & "elements of the array" and
outputs as "number Latest Answer: #include main(){ int a[] = { 1,-3,-5,-4,-
9,2,8}; int len,i,val; int npos=0, nneg=0; len = sizeof(a)/sizeof(a[0]);
printf("%dn",len); for( i=0; i< len; ...Read Answers (5) | Asked by : Tai

Answer Question Subscribe

Difference between void pointer and generic pointer?Latest Answer: I just


want to make a small point.When you assign an array to a pointer, you can't
put an & signint arr[5]={1,2,3},*p1;p1=arr;This will workint
arr[5]={1,2,3},*p1; p1=&arr; error: cannot convert `int (*)[5]' to `int*' in
assignmentThis ...Read Answers (3) | Asked by : srinivasaraoTags : Pointer

Answer Question Subscribe

Is nesting of conditional operator( ? : ) possible? If no then why? If yes then


write down the programIs nesting of conditional operator( ? : ) possible? If no
then why? If yes then write down the program to find the greatest of three
number?Yes, Nesting of conditional operator is possible .Write down the
program yourself. Read Answers (1) | Asked by : sanjeev

Answer Question Subscribe

What will be the output of the code?#includemain(){int a=10;int b;b=a++ +


20;printf("a= %d b= %d",What will be the output of the code?#includemain()
{int a=10;int b;b=a++ + 20;printf("a= %d b= %d", a, b);}The o/p will be 11
30. Can somebody tell me how? Read Answers (3) | Asked by : vrijesh28

Answer Question Subscribe

What is the difference between typedef & Macros?Latest Answer: typedef


defines a new type, in terms of existing types. Macros are simply text
replacements.As an example of the difference, try the following:#include
typedef char * ptr;#define PTR char *int main(void){ ptr a, b, c; ...Read
Answers (2) | Asked by : Deepak

Answer Question Subscribe

What is difference between && and & similarly || and | i.e., What is difference
between logical ANDWhat is difference between && and & similarly || and |
i.e., What is difference between logical AND and bit-wise AND?Read Answers
(1) | Asked by : sivashankar

Answer Question Subscribe

What does type qualifier volatile indicate to the compiler?Latest Answer: An


optimizing compiler can examine the flow of code and (in many cases)
determine whether a variable is actually modified or not; if not, then there's
no reason to read the value from memory more than once. Since reading
from memory is typically ...Read Answers (3) | Asked by : manohar

Answer Question Subscribe

Write a program in C to find the complex number of a given number.Latest


Answer: I don't understand whether the given number means an integer or a
float number. However, we cannot find any complex number from the given
number being a real number. It is possible to extract integers or even floating
numbers from a given complex ...Read Answers (1) | Asked by :
sachipatnaik2008

Answer Question Subscribe

You might also like