C Interview Questions

what is the difference between structural,object based,object orientd programming languages?

4272

How can we open a file in Binary mode and Text mode?what is the difference?

3738

can any one tel me wt is the question pattern for NIC exam

NIC,

1602

I need to take a sentence from input and sort the words alphabetically using the C programming language. Note: This is C not C++. qsort and strtok not allowed

14835

Hai sir, I had planned to write the NIC scientific engineer exam , plz post the sample question......

1790

Is main() function predfined or userdefined?

12657

what is difference between c and c++

5190

An interactive c program to read basic salary of 15 persons. each person gets 25% of basic as HRA, 15%of basic as conveyance allowances, 10%of basic as entertainment allowances.The total salary is calculated by adding basic+HRA+CA+EA.Calculate how many out of 15 get salary above 10,000.Rs also print the salary of each employee

6606

what is the use of keyword volatile??

6195

Convert a distance from miles to kilometers .there are 5280 feets per mile,12 inches per foot .2.54 centimeters per inch and 100000centimeters per kilometer

TCS,

2282

TCS,

4734

2.Given the short c program that follows a. make a list of the memory variables in this program b.which lines of code contain operations that change the contents of memory? what are those operations? Void main( void) { Double base; Double height; Double area; Printf(“enter base and height of triangle :”); Scanf(“%lg”, &base); Scanf(“%lg”, &height); Area=base*height/2.0; Printf(“the area of the triangle is %g \n”,area); }

3871

4.weight conversion: Write a program that will read weight in pounds and convert it into grams.print both the original weight and the converted value.There are 454 grams in a pound.design and carry out a test plan for this program.

6748

5. distance conversion: Convert a distance from miles to kilometers .there are 5280 feets per mile,12 inches per foot .2.54 centimeters per inch and 100000centimeters per kilometer

9556

what is the output for the code : main() { int i,j; printf("%d %d ",scanf("%d%d",&i,&j)); }

17051

What is the purpose of the preprocessor directive error?

739

Write a C program in Fibonacci series.

682

Explain the difference between getch() and getche() in c?

604

Is there a way to jump out of a function or functions?

691

What is local and global variable in c?

659

Write a factorial program using C.

686

What is the difference between fread buffer() and fwrite buffer()?

717

What is meant by type casting?

666

How can I get back to the interactive keyboard if stdin is redirected?

718

In cryptography, you could often break the algorithm if you know what was the original (plain) text that was encoded into the current ciphertext. This is called the plain text attack. In this simple problem, we illustrate the plain text attack on a simple substitution cipher encryption, where you know each letter has been substituted with a different letter from the alphabet but you don’t know what that letter is. You are given the cipherText as the input string to the function getwordSets(). You know that a plain text "AMMUNITION" occurs somewhere in this cipher text. Now, you have to find out which sets of characters corresponds to the encrypted form of the "AMMUNITION". You can assume that the encryption follows simple substitution only. [Hint: You could use the pattern in the "AMMUNITION" like MM occurring twice together to identify this]

2008

Explain what is wrong with this program statement?

671

Which is more efficient, a switch statement or an if else chain?

629

If one class contains another class as a member, in what order are the two class constructors called a) Constructor for the member class is called first b) Constructor for the member class is called second c) Only one of the constructors is called d) all of the above

667

Why shouldn’t I start variable names with underscores?

661

What is int main () in c?

672