You are on page 1of 2

Name-Siddharth jain

K-Id -K18048
Sub-C++

Q1 Input
Include<iostream.h>
Include<conio.h>
Void main( )
Float maths, English,art, To, av;
Cout<<“enter the marks of maths\n―
Cin>>Maths;
Cout<<“enter the marks of English\n;
Cin>> English;
Cout<<“enter the marks of art\n;
Cin>>art;
To=maths+English+art;
Cout<<“total marks=―<<to<<endl;
Av=(maths+ English+art)/3;
Cout<<Average is equal=―<<av;
Getch( );
Output
Enter the marks of maths
50
Enter the marks of English
70
Enter the marks of art
60
Average is = 60

Q3. Input
Include<iostream.h>
Include<conio.h>
Void main( )
{
float a , b , c , d;
Clrscr( ) ;
Include<iostream.h>
Include<conio.h>
Void main( )
{
Int fp;
Cout<<“ enter item price ― <<endl;
Cin>>a;
Cout<< Enter quantity
of iteam<<endl;
Cin>>fp;
B=fp*a;
C=(b*35)/100;
D=b-c;
Output
Entre item price
1000
Enter quantity of iteam
2
Total price = 1300
Q2 Input
#Include<iostream.h>
#Include<conio.h>
Void main( )
{
Clrscr ( );
float a , b , c , d;
Cout<<“enter your salary―<<endl;
Cin>>a;
B=(a)*0.5;
C=(b)*0.2;
D=b+a-c;
Cout<<“total salary=―<<to;
Getch( );
Out put
Enter your salary
1000
Totally salary
1400

Q4 Input
Include<iostream.h>
Include<conio.h>
Void main( )
{
Int a,b,c,n;
Clrscr( ) ;
Cout<<“enter two numbers―;
Cin>>a>>b;
Cout<<“enter \n 1.Add \n 2.sub \n 3.mult \n 4.div―;
Cin>>n;
Switch(n)
{
Case 1 :p= a+b;
Cout<<“sum is ―<<c;
Break;
Case 2 :c=a-b;
Cout<<“difference is―<<c;
Break
Case 3 :c=a*b;
Cout<<“product is―<<c;
Break
Case 4 :c=a/b;
Cout<<“remainder is ―<<c;
Break
Default:cout<<“invalid choice―;
Break;
}
Getch( );
}
Output
Enter two numbers 3
9
Enter
1 Add
2 Sub
3 milt
4 div
2
Difference is 6_

You might also like