Professional Documents
Culture Documents
________________________________________________________________________________________
2.Write a condition in c++ to check whether a number is equal to 10 or not using IF statement. (1)
________________________________________________________________________________________
4. Identify the errors in the following code and rewrite it (2)
main ()
{
Int a,B;
for(i==0,i<10;i+);
{
cout<<” @;
}
getch();
}
5. List any three rules for ‘switch case’ statement. (3)
___________________________________________________________________________
____________________________________________________________________________
1
6. Complete the following code and write its output. (1½)
#include<iostream.h>
OUTPUT:
#include<conio.h>
void main()
{
clrscr();
int a[5]={5,10,12,15,40}, _____;
for(i=0;i<5;_____________)
{
_____________________
}
Getch();
}
IV. Answer the following question
1. Differentiate between while and do-while loop. (1)
2
2. Write a C++ program for the following.
a. To check whether the given number is divisible by 5 or not. (2)
3
b. To check the odd number series of 1 to 5 using switch case. (3)
(2)