Escolar Documentos
Profissional Documentos
Cultura Documentos
DE-41 EE Semester 1
Fall 2019
LAB REPORT # 01
Submitted by Roll No
Topic(s) covered:
1- Data Types
2- Variable Declaration
3- Arithmetic Operations
Code:
#include<iostream>
int main()
cout << "You are too young to play the game" << endl;
cin.get();
return 0;
OUTPUT :
TASK 2:
Write five C++ statements to print the asterisk pattern as shown below.
*
**
***
****
*****
Code:
#include <iostream>
using namespace std;
int main()
{
cout << "*" << “\n**” << “\n***” << “\n****” << “\n*****” << endl;
cin.get();
return 0;
}
OUTPUT:
TASK 3:
Declare two integers and one float variable. Assign (initialize them to) 10, 15, and 12.6
to them respectively.
Code:
#include<iostream>
using namespace std;
int main()
{
//declaring variable and float//
int a, b;
float c;
//initializing//
a = 10;
b = 15;
c = 12.6;
system("pause");
return 0;
}
OUTPUT:
TASK 4
Take two integers as input from the user apply arithmetic operations on them(+,-,*,/)
and print them on screen.
Code:
#include<iostream>
using namespace std;
int main()
{
double a, b;
int sum, sub, mult;
double div;
cin >> a >> b;
sum = a + b;
cout << "sum " << sum << endl;
sub = a - b;
cout << "sub " << sub << endl;
mult = a*b;
cout << "mult "<< mult << endl;
div = a / b;
cout << "div "<< div << endl;
system("pause");
return 0;
}
OUTPUT :
TASK 5:
Give meaningful names and appropriate data types for the following variables.
Code:
#include<iostream>
using namespace std;
int main()
{
double PriceOfItem;
int JuiceBottles;
float MilesTravelled;
int CountOfStudents;
char Alphabet;
system("pause");
return 0;
}
OUTPUT:
Conclusion:
In this lab we have learned about Data Types ,Variable And Basic Arithmetic Operations.