Posts

Showing posts from September, 2016

Assignment on Looping Constructs

Assignment on control structures Q. 1 Identify the following in the loops:          I.                           Loop control variable        II.                        Initialization expression      III.                      Update expression      IV.                        Test expression a.              a.    for (int p=4; p<9; p++)          cout<<p; b.        b .    int  x=9; do {  cout<<x++; }while(x<15); c.         C.      int m=6; while(m<15) { cout<< m; m++; } d.                      d. char ch=’a’;        while(ch<’g’)       { cout<<ch;          ch++;         }   Q.2.  Fill up the blanks for the following loops: a. A loop to find and display the sum of numbers between 4 and 40.              int sum=________; for(_________;________;___________)                    sum___________;                 __________________ b.  A loop to find and display the sum of multiples of 3 bet

Assignment for Half Yearly Examination

Assignment for half yearly preparation Class XI Q.1.a) What is the difference between automatic type conversion and type casting ?Give example to explain both.                                                                                                                                                                 b) Give any four differences between switch and if-else without giving any example.                                                                                                                                           c ) Give   differences between break , continue and exit with example . d)Give difference between while and do while loops. e) What is the difference between if and switch statements? f) What is the difference between ‘x’ and “x”? g) How can you give a single line and multiline comments in C++ explain with suitable examples. h) What will be the value of a=5/3 if a is (i) int (ii)float   ? Q.2. Name the header files neede