C Interview Questions
Questions Answers Views Company eMail

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

TCS,

5 5082

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

TCS,

4 7129

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,

7 6201




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

TCS,

7 7860

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

TCS,

9 10800

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;..}

TCS,

4 4256

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

TCS, ZenQ,

2 8560

# 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 11147




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

TCS,

7 7308

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

TCS,

7 5980

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

TCS, Amdocs,

10 15619

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

TCS,

4 5966

int *a[5] refers to

TCS,

12 15233

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 9296

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 14631


Post New C Questions






Un-Answered Questions { C }

all c language question

940


please can any one suggest me best useful video tutorials on c i am science graduate.please help me.u can email me to sas29@in.com

523


You have given 2 array. You need to find whether they will create the same BST or not. For example: Array1:10 5 20 15 30 Array2:10 20 15 30 5 Result: True Array1:10 5 20 15 30 Array2:10 15 20 30 5 Result: False One Approach is Pretty Clear by creating BST O(nlogn) then checking two tree for identical O(N) overall O(nlogn) ..we need there exist O(N) Time & O(1) Space also without extra space .Algorithm ?? DevoCoder guest Posted 3 months ago # #define true 1 #define false 0 int check(int a1[],int a2[],int n1,int n2) { int i; //n1 size of array a1[] and n2 size of a2[] if(n1!=n2) return false; //n1 and n2 must be same for(i=0;ia1[i+1]) && (a2[i]>a2[i+1]) ) ) return false; } return true;//assumed that each array doesn't contain duplicate elements in themshelves }

1820


The postoder traversal is 7,14,3,55,22,5,17 Then ur Inorder traversal is??? please help me on this

1741


hi to every one .. how to view table pool after creating the pooled table? plz help me.. if any knows abt this ..

638






I need previous papers of CSC.......plz help out by posting them.......

905


Write a program to generate a pulse width frequency of your choise,which can be variable by using the digital port of your processor

2040


Hai,I have done with my bachelor of commerce and planing to ms,please suggest me how to convince vo for shifting from commerce to computers. Visa on 8 DEC 2014  Npu university

805


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

2388


Draw a diagram showing how the operating system relates to users, application programs, and the computer hardware ?

1194


write a program to generate address labels using structures?

1370


stripos — Find position of first occurrence of a case- insensitive string int stripos ( char* haystack, char* needle, int offset ) Returns the numeric position of the first occurrence of needle in the haystack string. Note that the needle may be a string of one or more characters. If needle is not found, stripos() will return -1. The function should not make use of any C library function calls.

979


write a c program to find the sum of five entered numbers using an array named number

863


write a program to convert a expression in polish notation(postfix) to inline(normal) something like make 723+* (2+3) x 7 (not sure) just check out its mainly printing expression in postfix form to infix.

2380


what is the diffrenet bettwen HTTP and internet protocol

613