C Interview Questions
Questions Answers Views Company eMail

Switch (i) i=1; case 1 i++; case 2 ++i; break; case 3 --i; Output of i after executing the program

Mascot,

5 5860

char S; char S[6]= " HELLO"; printf("%s ",S[6]); output of the above program ? (0, ASCII 0, I,unpredictable)

Mascot,

7 7888

Unsigned char c; for ( c=0;c!=256;c++2) printf("%d",c); No. of times the loop is executed ?

TCS, Mascot,

8 10644




int i; i=2; i++; if(i=4) { printf(i=4); } else { printf(i=3); } output of the program ?

Mascot,

15 10515

write a C code to reverse a string using a recursive function, without swapping or using an extra memory.

TCS, Wipro, Motorola,

9 33613

write a C code To reverse a linked list

Wipro, Motorola,

2 11873

Difference between Class and Struct.

Ericsson, Wipro, Motorola,

13 29766

Tell about strtok & strstr functions

Motorola, iFlex,

2 13871




two progs are given. one starts counting frm 0 to MAX and the other stars frm MAX to 0. which one executes fast.

Verifone,

5 4637

int a=2,b=3,c=4; printf("a=%d,b=%d\n",a,b,c); what is the o/p?

Verifone,

6 10286

C program code int zap(int n) { if(n<=1)then zap=1; else zap=zap(n-3)+zap(n-1); } then the call zap(6) gives the values of zap [a] 8 [b] 9 [c] 6 [d] 12 [e] 15

TCS, Wipro,

6 13756

n=7623 { temp=n/10; result=temp*10+ result; n=n/10 }

Wipro,

7 7201

int zap(int n) { if(n<=1)then zap=1; else zap=zap(n-3)+zap(n-1); } then the call zap(6) gives the values of zap [a] 8 [b] 9 [c] 6 [d] 12 [e] 15

Wipro,

10 8318

The C language terminator is a.semicolon b.colon c.period d.exclamation mark

TCS,

6 8363

What is false about the following A compound statement is a.A set of simple statments b.Demarcated on either side by curly brackets c.Can be used in place of simple statement d.A C function is not a compound statement.

TCS, CCEM,

5 15699


Post New C Questions






Un-Answered Questions { C }

can we have joblib in a proc ?

929


can we change the default calling convention in c if yes than how.........?

1271


4-Take two sets of 5 numbers from user in two arrays. Sort array 1 in ascending and array 2 in descending order. Perform sorting by passing array to a function mySort(array, sortingOrder). Then multiply both the arrays returned from function, using metric multiplication technique in main. Print result in metric format.

864


Which is the memory area not included in C program? give the reason

790


Difference between Shallow copy and Deep copy?

843






C program to find all possible outcomes of a dice?

1178


Write the program with at least two functions to solve the following problem. The members of the board of a small university are considering voting for a pay increase for their 10 faculty members. They are considering a pay increase of 8%. Write a program that will prompt for and accept the current salary for each of the faculty members, then calculate and display their individual pay increases. At the end of the program, print the total faculty payroll before and after the pay increase, and the total pay increase involved.

1522


write a program to copy the string using switch case?

1658


Using functions, write a program that multiplies two arrays. Use the following functions: - Function ReadArray - Function MultiplyArrays - Function DisplayArrays

1081


hi friends how r u as soon in satyam my interview is start but i m very confusued ta wat i do plz help me frndz wat can i do plz tell me some question and answers related with "C" which r asked in the interview .

1082


5 Write an Algorithm to find the maximum and minimum items in a set of ‘n’ element.

837


what is the height of tree if leaf node is at level 3. please explain

851


write an interactive C program that will encode or decode a line of text.To encode a line of text,proceed as follows. 1.convert each character,including blank spaces,to its ASCII equivalent. 2.Generate a positive random integer.add this integer to the ASCII equivalent of each character.The same random integer will be used for the entire line of text. 3.Suppose that N1 represents the lowest permissible value in the ASCII code,and N2 represents the highest permissible value.If the number obtained in step 2 above(i.e.,the original ASCII equivalent plus the random integer)exceeds N2,then subtract the largest possible multiple of N2 from this number,and add the remainder to N1.Hence the encoded number will always fall between N1 and N2,and will therefore always represent some ASCII character. 4.Dislay the characters that correspond to the encoded ASCII values.  The procedure is reversed when decoding a line of text.Be certain,however,that the same random number is used in decodingas was used in encoding.

1519


write a proram to reverse the string using switch case?

1459


simple program of graphics and their output display

752