C Interview Questions
Questions Answers Views Company eMail

the operator for exponencation is a.** b.^ c.% d.not available


5 5119

what is y value of the code if input x=10 y=5; if (x==10) else if(x==9) elae y=8; a.9 b.8 c.6 d.7


4 7251

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


7 6303

a=0; while(a<5) printf("%d\n",a++); how many times does the loop occurs? a.infinite b.5 c.4 d.6


7 7989

how many times does the loop iterated ? for (i=0;i=10;i+=2) printf("Hi\n");


9 10943

which of the following go out of the loopo if expn 2 becoming false a.while(expn 1){...if(expn 2)continue;} b.while(!expn 1){if(expn 2)continue;...} c.do{..if(expn 1)continue;..}while(expn 2); d.while(!expn 2){if(expn 1)continue;..}


4 4313

pick out the odd one out of the following a.malloc() b.calloc() c.free() d.realloc()

TCS, ZenQ,

2 8663

# define prod(a,b)=a*b main() { int x=2; int y=3; printf("%d",prod(x+2,y-10)); } the output of the program is a.8 b.6 c.7 d.none

Microsoft, TCS,

7 11339

consider the following program sigment int n,sum=1; switch(n) { case 2:sum=sum+2; case 3:sum*=2; break; default:sum=0;} if n=2, what is the value of sum a.0 b.6 c.3 d.none


7 7428

the format specified for hexa decimal is a.%d b.%o c.%x d.%u


7 6055

find the output of the following program main() { int x=5, *p; p=&x; printf("%d",++*p); }

TCS, Amdocs,

10 15798

consider the following C code main() { int i=3,x; while(i>0) { x=func(i); i--; } int func(int n) { static sum=0; sum=sum+n; return(sum); } the final value of x is


4 6069

int *a[5] refers to


12 15394

which of the following statements is incorrect a.typedef struct new{ int n1; char n2; } DATA; b.typedef struct { int n3; char *n4; }ICE; c.typedef union { int n5; float n6; } UDT; d.#typedef union { int n7; float n8; } TUDAT;

Assurgent, TCS,

5 9481

main() { char *p1="Name"; char *p2; p2=(char *)malloc(20); while(*p2++=*p1++); printf("%s\n",p2); } what is the output?

HCL, Ramco, AMCAT, Zycus Infotech,

7 14939

Post New C Questions

Un-Answered Questions { C }

Why is it important to memset a variable, immediately after allocating memory to it ?


write a program to print the consecutive repeated character from the given string... input string is : hhhhjkutskkkkkggggj output should be like this: hhhhkkkkkgggg anyone help me...


write a program using linked list in which each node consists of following information. Name[30] Branch Rollno Telephone no i) Write the program to add information of students in linked list


a c code by using memory allocation for add ,multiply of sprase matrixes


what is uses of .net


What is pre-emptive data structure and explain it with example?


write a program that types this pattern: 12345678987654321 12345678 87654321 1234567 7654321 123456 654321 12345 54321 1234 4321 123 321 12 21 1 1


hi send me sample aptitude papers of cts?


Write a Program to accept different goods with the number, price and date of purchase and display them


Write a C program to count the number of email on text


You are to write your own versions of strcpy() and strlen (). Call them mystrcpy() and mystrlen(). Write them first as code within main(), not as functions, then, convert them to functions. You will pass two arrays to the function in the case of mystrcpy(), the source and target array.


what will be the output for the following main() { printf("hi" "hello"); }


How to establish connection with oracle database software from c language?


write a program to input 10 strings and compare without using strcmp() function. If the character of one string matches with the characters of another string , sort them and make it a single string ??? example:- str1="Aakash" st2="Himanshu" str="Uday" output:- Aakashimanshuday (please post the answer as quickly as possible)


the question is that what you have been doing all these periods (one year gap)