Vous êtes sur la page 1sur 2

SMT. SULOCHANADEVI SINGHANIA SCHOOL,THANE.

STD 8 PRACTICE WORKSHEET 1/ JULY 2015

Question 1 .Identify the errors and rewrite the correct program:


1.
Void main( )
{
Int a;
clrscr();
cout>>Enter a number>>endl;
cin<<a;
cout>>The number is>>a;
getch();
}
2.
#include <conio.h>
#include <conio.h>
void Main( )
{
float a; b;
clrscr();
cout<<Enter a float value for a and b<<endl;
cin<<a<<b;
int sum = a+b;
cout<<The sum is<<sum;
getch();
}
Question 2. Write a program in C++ to input price of a product and quantity.
Calculate the total price and display.

Question 3. Answer the following questions:


1. What is a compiler? What does it do?
2. Name the two header files in C++.
3. Name the datatype used in C++ to input alphanumeric values.
Question 4. Predict the output of the following code:
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int a =4,b=7,c=2,ans1;
c=c+1;
cout<<c;
ans1=b/a;
cout<<ans1;
getch();
}

*******************

Vous aimerez peut-être aussi