C Interview Questions
Questions Answers Views Company eMail

write a program to display the numbers in the following 4 4 3 3 2 2 1 1 0 1 1 2 2 3 3 4 4

1 1693

write a program to display the numbers in the following format 4 4 3 3 3 3 2 2 2 2 2 2 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 2 2 2 2 2 3 3 3 4

NIIT, IBM, Winit,

9 6696

what is the output of the program and explain why?? #include void main ( ) { int k=4,j=0: switch (k) { case 3; j=300; case 4: j=400: case 5: j=500; } printf (“%d\n”,j); }

Oracle,

14 7813




What is the real time usage volatile?

Polycom,

2 3583

what are the stoge class in C and tel the scope and life time of it?

Tech Mahindra,

2 3262

What will be the result of the following program? char*g() { static char x[1024]; return x; } main() { char*g1="First String"; strcpy(g(),g1); g1=g(); strcpy(g1,"Second String"); printf("Answer is:%s", g()); } (A) Answer is: First String (B) Answer is: Second String (C) Run time Error/Core Dump (D) None of these

Oracle,

2 4454

. Consider the following program main() { int a[5]={1,3,6,7,0}; int *b; b=&a[2]; } The value of b[-1] is (A) 1 (B) 3 (C) -6 (D) none

Oracle,

9 9605

Given a piece of code int x[10]; int *ab; ab=x; To access the 6th element of the array which of the following is incorrect? (A) *(x+5) (B) x[5] (C) ab[5] (D) *(*ab+5} .

Oracle,

2 5205




What is the output of the following progarm? #include main( ) { int x,y=10; x=4; y=fact(x); printf(“%d\n”,y); } unsigned int fact(int x) { return(x*fact(x-1)); } A. 24 B. 10 C. 4 D. none

2 3305

What is the o/p of the follow pgm? #include main() { char char_arr[5]=”ORACL”; char c=’E’; prinf(“%s\n”,strcat(char_arr,c)); } a:oracle b. oracl c.e d.none

Oracle,

2 2861

#include main() { int a[3]; int *I; a[0]=100;a[1]=200;a[2]=300; I=a; Printf(“%d\n”, ++*I); Printf(“%d\n”, *++I); Printf(“%d\n”, (*I)--); Printf(“%d\n”, *I); } what is the o/p a. 101,200,200,199 b. 200,201,201,100 c. 101,200,199,199 d. 200,300,200,100

1 2940

What is 'makefile' in C langauage? How it be useful? How to write a makefile to a particular program?

2 5897

Is main() is used in the program,,see below example? void main() { int i; for(i=0;i<10;i++) main(); } Then what is the output of the program?

6 3052

What is the output for the below program? void main() { float me=1.1; double you=1.1; if(me==you) printf("love c"); else printf("know c"); }

7 4527

What is the output of the below program and how it is? void main() { static int var=5; printf("%d",var--); if(var) main(); }

TCS, Tech Mahindra, MindFire,

7 11747


Post New C Questions






Un-Answered Questions { C }

What is the difference between specifying a constant variable like with constant keyword and #define it? i.e what is the difference between CONSTANT FLOAT A=1.25 and #define A 1.25

721


In this problem you are to write a program that will cut some number of prime numbers from the list of prime numbers between 1 and N.Your program will read in a number N; determine the list of prime numbers between 1 and N; and print the C*2 prime numbers from the center of the list if there are an even number of prime numbers or (C*2)-1 prime numbers from the center of the list if there are an odd number of prime numbers in the list.

625


If a five digit number is input through the keyboard, write a program to print a new number by adding one to each of its digits.For example if the number that is input is 12391 then the output should be displayed as 23402

1890


I completed my B.tech (IT). Actually I want to develop virtual object that which will change software technology in the future. To develop virtual object what course I have to take. can I any professor to help me.

973


C language questions for civil engineering

362






write a sorting prgm to sort 50 nos and sum them and also remove all the occurrences of 15 and print it?

886


I was asked to write a program in c which when executed displays how many no.of clients are connected to the server.

1135


how is the examination pattern?

857


1234554321 1234 4321 123 321 12 21 1 1 12 21 123 321 1234 4321 1234554321

1948


writ a program to compare using strcmp VIVA and viva with its output.

719


Difference between Shallow copy and Deep copy?

832


we need to calculating INCOME TAX for the person. The INCOME TAX is as follows:- First $10000/- of income : 4% tax Next $10000/- of income : 8% tax Next $10000/- of income : 11.5% tax above $10, 00,00/- : 15% tax What is the Solution of this Question ?

53


Without Computer networks, Computers will be half the use. Comment.

985


Is there any algorithm to search a string in link list in the minimum time?(please do not suggest the usual method of traversing the link list)

866


how to construct a simulator keeping the logical boolean gates in c

822