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 1714

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 6816

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 7931




What is the real time usage volatile?

Polycom,

2 3613

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

Tech Mahindra,

2 3289

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 4530

. 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 9750

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 5294




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 3349

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 2885

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

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

2 5936

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 3089

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 4590

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 11813


Post New C Questions






Un-Answered Questions { C }

which type of aspect you want from the student.

912


how to print electricity bill according to following charges first 100 units -1rs per unit for next 200 units-1.50 rs per unit without using conditions

1955


Write a C program that will accept a hexadecimal number as input and then display a menu that will permit any of the following operations to be carried out: Display the hexadecimal equivalent of the one's complement. (b) Carry out a masking operation and then display the hexadecimal equivalent of the result. (c) Carry out a bit shifting operation and then display the hexadecimal equivalent of the result. (d) Exit. If the masking operation is selected, prompt the user lor the type of operation (bitwise and, bitwise exclusive or, or bitwise or) and then a (hexadecimal) value for the mask. If the bit shifting operation is selected. prompt the user for the type of shift (left or right), and then the number of bits. Test the program with several different (hexadecimal) input values of your own choice.

3601


Explain the process of converting a Tree into a Binary Tree.

1154


PROGRAM TO WRITE CONTENTS OF 1 FILE IN REVERSE TO ANOTHER FILE,PROGRAM TO COPY 1 FILE TO ANOTHER BY SPECIFYING FILE NAMES AS COMMAND LINE

751






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

1447


Give basis knowledge of web designing ...

850


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.

866


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

767


write a c program to find the largest and 2nd largest numbers from the given n numbers without using arrays

1081


One of the Institutes contains 5 student groups. Every group contains 4 students. Institute wants to store student group’s details in array. Group should contain group member’s details (name and registration number and age), project name, and mark of the group.

1345


How to write a program for machine which is connected with server for that server automatically wants to catch the time for user of that machine?

876


Which driver is a pure java driver

190


Given a valid 24 hour format time find the combination of the value and write a program ,do not hard the value and if any other inputs provided should work with the logic implemented Input: 11:30 Output: 13:10 Input: 18:25 Output: 21:58

211


What is ambagious result in C? explain with an example.

1098