Skip to main content

C Programming Interview Questions (C/C++ ProgrammingQuiz - 3)

1. The number of main( ) functions in a C program is
[A]Only one
[B]At least one
[C]More than one
[D]Dependent on the program


2. In C, a variable that contains the address of another variable is called
[A]Array
[B]Structure
[C]Linked List
[D]Pointer


3. Which of the following statements is used to execute body of the loop at least once in a ‘C’ program?
[A]While statement
[B]Do while statement
[C]If statement
[D]If-else statement


4. Which of the following reads a floating-point value in C programming language?
[A]% e
[B]% x
[C]% h
[D]% i


5. The default initial value is zero for which of the following storage classes in C language?
[A]Automatic
[B]External
[C]Static
[D]Both (b) and (c) above


6. Which of the following is not a correct rule with respect to variables in C language?
[A]Variables should begin with a letter
[B]Variables are case sensitive
[C]Variable names should not be keywords
[D]Underscores are not allowed in defining variable names


7. Which of the following is not correct regarding decision-making statements in C programming language?
[A]A condition is expressed using C’s relational operators
[B]The relational operators compare two values to see whether they are equal to each other, not equal or whether one is greater than the other
[C]The keyword ‘if’ tells the compiler that it is a decision control instruction
[D]The ‘else’ statement will be executed if the condition specified is true


8. The output of the following program is
main()
{
int a = 5;
do
{
printf(“%d\n”, ++a);
a = -1;
}while(0);
}
[A]4
[B]5
[C]6
[D]Error


9. Which of the following is not true about a Linked List in C?
[A]Linked List is a list whose order is given by links from one item to the next
[B]Each structure of a Linked List is called a node
[C]Each node in a Linked List consists of two fields, one containing the item (value) and the other containing the address of the next item
[D]A Linked List is a collection of structures ordered by their physical placement in the memory


10. Which of the following is not a correct rule with respect to variables in C language?
[A]Variables should begin with a letter
[B]Variables are case sensitive
[C]Variable names should not be keywords
[D]Underscores are not allowed in defining variable names


11. The default initial value is zero for which of the following storage classes in C language?
[A]Automatic
[B]External
[C]Static
[D]Both (b) and (c) above


12. User-defined functions are contained in which of the following sections of a C program?
[A]Documentation Section
[B]Definition Section
[C]Global Declaration Section
[D]Sub Program Section


13. The link between a member and a variable in a C Structure is established using which of the following operators?
[A]Logical operator
[B]Increment operator
[C]Dot operator
[D]Conditional operator


14. Which of the following is false with respect to Integer Constant in C programming language?
[A]It should have at least one digit
[B]It may be either positive or negative
[C]It may have a decimal point
[D]No commas or blanks are allowed


15. Which of the following tasks is carried out by ‘for’ loop in C programming language?
I. Initializing the loop counter.
II. Testing the loop counter to determine whether its value has reached the number of repetitions desired.
III. Incrementing the value of the loop counter each time the segment within the loop has been executed.
[A]Only (I) above
[B]Only (II) above
[C]Both (I) and (II) above
[D]All (I), (II) and (III) above


Comments

Popular posts from this blog

Email Etiquette Quiz

1. Which of the following is considered to be poor e-mail etiquette? [A]Have a proper sign off: Regards, Sincerely, etc. [B]Responding to messages as soon as possible [C]Using different colors/fonts/formatting to emphasize certain words [D]Keeping the message personal 2. What should be the tone of a professional email message? [A]Formal [B]Casual [C]Formal with slight usage of slangs [D]Conversational 3. What is the purpose of the BCc field? [A]To send copies of business e-mail to coworkers without the knowledge of boss [B]To respect contact's privacy [C]To keep e-mail looking clean [D]To send copies to anyone you want 4. What is the best way to send a very large attachment? [A]Compress the file (zip it up) [B]Send it first thing in the morning so that person can look into it with fresh mind [C]Send it only during weekend when traffic is low [D]Compress the file, then ask first when would be the best time to e-mail it 5. What is Flame? [A]A post or email message that exhibi

Krishna Janmashtami Quiz

1. Krishna Janmashtami is an annual Hindu festival that celebrates the birth of Krishna, the ____________ avatar of Vishnu. [A]Sixth [B]Seventh [C]Eighth [D]Ninth 2. Krishna was the son of? [A]Devaki [B]Vasudeva [C]Kansa [D]A & B 3. Janmashtami is an important festival particularly to which tradition of Hinduism? [A]Shaivism [B]Shaktism [C]Smartism [D]Vaishnavism 4. Which festival is celebrated every August/September, the day after Krishna Janmashtami mainly in Maharashtra? [A]Makhan Handi [B]Dahi Handi [C]Ghee Handi [D]Mitti Handi 5. In which city Bhagwan Krishna was born? [A]Dwarka [B]Vrindavan [C]Mathura [D]Kurukshetra 6. Janmashtami or Sri Krishna Jayanti celebrates the birthday of Krishna. It is also known by which name in Maharashtra and South India? [A]Gokulashtami [B]Bal Ashtami [C]Krishna Ashtami [D]Nandashtami 7. Fiji's Janmastami celebrations last for eight days, leading up to the eighth day, the day Krishna was born. Janmastami in Fiji is known as [A]G

Class 2 | Means of Communication | EVS General Awareness | Quiz

1. We keep in touch with everyone through- means of communication means of transport means of production none 2. Which of the following are personal means of communication? Letter Mobile e-mail All of the above 3. We post our letters in a - Wooden Box Almirah Letter box Bank 4. From where do we get postal stamps? Bank Post office Milk booth Grocery shop 5. Which of the following are means of mass communication? Radio Newspaper Telephone Radio and Newspaper 6. Which of the following is NOT a means of personal communication? Radio Letter Post card Fax 7. Which means of communication will you use to call your friend for your birthday party? Newspaper Television Mobile Letter 8. Urgent messages were earlier sent by telegram. The message in a telegram had to be ___________ as each word was paid for. Long Short No message is sent by telegram Very long 9. Which of the following are also called modern means of communication? Telephone Mobile e-mail All of the above 10. Which of the following i