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


5 5725

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


7 7707

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

TCS, Mascot,

8 10408

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


15 10300

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

TCS, Wipro, Motorola,

9 33415

write a C code To reverse a linked list

Wipro, Motorola,

2 11757

Difference between Class and Struct.

Ericsson, Wipro, Motorola,

13 29547

Tell about strtok & strstr functions

Motorola, iFlex,

2 13619

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


5 4565

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


6 9906

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 13319

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


7 6990

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


10 8030

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


6 8224

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.


5 15506

Post New C Questions

Un-Answered Questions { C }

please give me some tips for the placement in the TCS.


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


At a shop of marbles, packs of marbles are prepared. Packets are named A, B, C, D, E …….. All packets are kept in a VERTICAL SHELF in random order. Any numbers of packets with these names could be kept in that shelf as in this example: bottom of shelf ---> [AAAJKRDFDEWAAYFYYKK]-----Top of shelf. All these packets are to be loaded on cars. The cars are lined in order, so that the packet could be loaded on them. The cars are also named [A, B, C, D, E,………….]. Each Car will load the packet with the same alphabet. So, for example, car ‘A’ will load all the packets with name ‘A’. Each particular car will come at the loading point only once. The cars will come at the loading point in alphabetical order. So, car ‘B’ will come and take all the packets with name ‘B’ from the shelf, then car ‘C’ will come. No matter how deep in the shelf any packet ‘B’ is, all of the ‘B’ packets will be displaced before the ‘C’ car arrives. For that purpose, some additional shelves are provided. The packets which are after the packet B, are kept in those shelves. Any one of these shelves contains only packets, having the same name. For example, if any particular shelf is used and if a packet with name X is in it, then only the packets having names X will be kept in it. That shelf will look like [XXXXXXX]. If any shelf is used once, then it could be used again only if it is vacant. Packets from the initial shelf could be unloaded from top only. Write a program that finds the minimum total number of shelves, including the initial one required for this loading process.


while initialization of array why we use a[][2] why not a[2][]...?


what is the structure pointer?


Stimulate calculator using Switch-case-default statement for two numbers


Write a program to compute the similarity between two strings - The program should get the two strings as input - Then it will output one single number which is the percentage of similarity between the two strings


c program to compute AREA under integral


Write the program that calculates and prints the average of several integers. Assume that the last value read is sentinel 9999.


using for loop sum 2 number of any 4 digit number in c language


what is the significance of static storage class specifier?


what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;


1) write a program to generate 1st n fibonacci prime numbers using Nested if 2) write a program to generate twin prime numbers from m to n using nested if 3) write a program to check whether a given integer is a strong number or not using nested if 4) Write a program to generate prime factors of a given integer using nested if 5)write a program to generate prime numbers from m to n using nested if 6)write a program to generate perfect numbers from m to n using nested if 7)write a program to generate the pallindromes from m to n using neste if 8)write a program to generate armstrong numbers from m to n using nested if 9)write a program to generate strong numbers from m to n using nested if


write a program in C that prompts the user for today's date,tomorrow's date and display the results.Use structures for today's date,tomorrow's date and an array to hold the days for each month of the year.


write a c program thal will find all sequences of length N that produce the sum is Zero, print all possible solutions?