Introduction to computer programming (c++) likely question

image credit:google

 C++ likely question

1.  The operator << is known as the........................operator.

2.   Differentiate briefly between the while loop and the do while loop

3.   Differentiate between std::cout and cout. explain briefly when to use theme correctly in your c++ code

4.   What is the meaning of a variable declared as short unsigned int K  

5.   AND Gate operates like a pair of switches connected in.....................

6.    Differentiate briefly between Local and Global Variables

7.    Give one examples each of integer literals and floating point literals

 8.    An array of type int mate [4] has a maximum index of .............................

9.     A variable is a name give to a ...........................

10.   the conditional operator 7>4? 5:8 will return an output of .........................

11.   The Bitwise Operator ^ is called........................

Answer




1. Write down the algorithm, pseudocode and draw the flowchart to 

a. Sum odd number from 1 to 40. your algorithm should further find the square root of the final answer.

b.  find the factorial of any number. the algorithm should allow user input.


2.  a. Draw the logic diagram and find the truth table for the boolean expression p=(A.B).(A+B).C

      b. If A=20 and B=10, find bitwise result for :A&B,A|B,A^B

      c. Write down a simple C++ program using a loop to find the factorial of a number given user input.



  


Post a Comment

Previous Post Next Post