Lab Sol Manual
Lab Sol Manual
INSTRUCTOR NAME:-
Group Members:-
DEPARTMENT:-
ELECTRICAL ENGINEERING
SYNDICATE:-
TASK 1:-
INPUT
OUTPUT:-
TASK 2:-
INPUT:-
OUTPUT:-
TASK 3:-
INPUT
OUTPUT
TASK 4:-
INPUT
OUTPUT
TASK 5:-
INPUT
OUTPUT
TASK 6:-
INPUT
#include <iostream>
using namespace std;
int main(){
int a;
cout << "enter the month no: ";
cin >> a;
if (a == 1 || a == 3 || a == 5 || a == 7 || a == 8 || a == 10 || a == 12)
cout << "no of days:31 " << endl;
if (a == 4 || a == 6 || a == 9 || a == 11)
cout << "no of days:30 " << endl;
if (a == 2)
cout << "no of days:28 " << endl;
return 0;
}
OUTPUT
enter the month no: 3
no of days:31
Press any key to continue . . .
TASK 7:-
INPUT
#include <iostream>
using namespace std;
int main(){
int a = 0, a500,a100, a50, a20, a10, a5, a2, a1;
cout << "enter the amount" << endl;
cin >> a;
a500 = a / 500;
a = a % 500;
a100 = a / 100;
a = a % 100;
a50 = a / 50;
a = a % 50;
a20 = a / 20;
a = a % 20;
a10 = a / 10;
a = a % 10;
a5 = a / 5;
a = a % 5;
a2 = a / 2;
a = a % 2;
a1 = a / 1;
cout << "we need " << a500 << "notes of 500 " << endl;
cout << a100 << "notes of 100 " << endl;
cout << a50 << "notes of 50 " << endl;
cout << a20 << "notes of 20 " << endl;
cout << a10 << "notes of 10 " << endl;
cout << a5<< "notes of 5 " << endl;
cout << a2 << "notes of 2 " << endl;
cout << a1 << "notes of 1 " << endl;
system("pause");
OUTPUT
enter the amount
999
we need 1notes of 500
4notes of 100
1notes of 50
2notes of 20
0notes of 10
1notes of 5
2notes of 2
0notes of 1
Press any key to continue . . .
TASK 8:-
INPUT
#include <iostream>
#include <cmath>
using namespace std;
void main()
{
const float b = .50;
const float c = .75;
const float e = 1.20;
const float f = 1.50;
const float d = 0.2;
system("pause");
}
OUTPUT
enter your units
556
bill to units is =679
total bill is 814.8
Press any key to continue . . .
TASK 9:-
INPUT
Output:-