Lab Task 0-Roll No-11
Lab Task 0-Roll No-11
FUNDAMENTALS
LAB TASK 0
[DATE]
FACULTY OF COMPUTING AND ENGINEERING
Session 2022-2026
PROGRAMMING FUNDAMENTALS
Progam 01:
#include<iostream>
using namespace std;
int main()
{
cout<<" ##########################"<<endl;
cout<<"$$$$******************************$$$$"<<endl;
cout<<"********\\\\\WELCOME to CUST********"<<endl;
cout<<"$$$$******************************$$$$"<<endl;
cout<<" ##########################"<<endl;
return 0;
1
PROGRAMMING FUNDAMENTALS
Program 02:
#include <iostream>
int main()
cout<<"***MY INTRODUCTION***"<<endl;
return 0;
2
PROGRAMMING FUNDAMENTALS
Program 03:
#include<iostream>
int main()
cout<<"CS1234\t|\tProgramming\t| 4"<<endl;
cout<<"CS1123\t|\tCal-1\t | 4"<<endl;
cout<<"CS1121\t|\tAlgebra\t | 3"<<endl;
return 0;
3
PROGRAMMING FUNDAMENTALS
Program:04
#include<iostream>
int main()
cout<<"NAME\t|\tAROOSHA"<<endl;
cout<<"Emp_no\t|\tEmp_123"<<endl;
cout<<"Salary\t|\t30000"<<endl;
return 0;
4
PROGRAMMING FUNDAMENTALS
Program 05:
#include<iostream>
int main()
cout<<"Jan | 100"<<endl;
cout<<"Feb | 150"<<endl;
cout<<"March | 130"<<endl;
cout<<"April | 90"<<endl;
cout<<"May | 110"<<endl;
cout<<"June | 135"<<endl;
return 0;
5
PROGRAMMING FUNDAMENTALS
Program 06:
#include<iostream>
int main()
cout<<"Allowances | Amount"<<endl;
cout<<"Medical | 1500"<<endl;
cout<<"TA/DA | 2000"<<endl;
cout<<"Bonus | 50000"<<endl;
return 0;
6
PROGRAMMING FUNDAMENTALS
Program 07:
#include<iostream>
int main()
return 0;
7
PROGRAMMING FUNDAMENTALS
Program 08:
#include<iostream>
int main()
int x;
cin>>x;
cout<<++x<<endl;
cout<<--x<<endl;
cout<<x++<<endl;
cout<<x--<<endl;
return 0;
8
PROGRAMMING FUNDAMENTALS
Program 09:
#include<iostream>
int main()
int a,b;
cin>>a;
cin>>b;
cout<<"a+b= "<<a+b<<endl;
cout<<"a-b= "<<a-b<<endl;
cout<<"a*b= "<<a*b<<endl;
cout<<"a/b= "<<a/b<<endl;
return 0;
9
PROGRAMMING FUNDAMENTALS
Program 10:
#include<iostream>
int main()
cout<<"4\n5\6\n7\n8";
return 0;
10
PROGRAMMING FUNDAMENTALS
int main()
int age;
cin>>age;
if(age<=70){
else{
return 0;
11
PROGRAMMING FUNDAMENTALS
Program 02:
#include<iostream>
using namespace std;
int main()
{
int marks;
cout<<"Enter Marks: ";
cin>>marks;
if(marks>90)
cout<<"Grade A"<<endl;
else if((marks>=86)&&(marks<=90))
cout<<"Grade A-";
else if((marks>=81)&&(marks<86))
cout<<"Grade B";
else if((marks>=77)&&(marks<81))
cout<<"Grade B";
else if((marks>=72)&&(marks<77))
cout<<"Grade B-";
else if((marks>=68)&&(marks<72))
cout<<"Grade C+";
else if((marks>=63)&&(marks<68))
cout<<"Grade C";
12
PROGRAMMING FUNDAMENTALS
else if((marks>=58)&&(marks<63))
cout<<"Grade C-";
else if((marks>=54)&&(marks<58))
cout<<"Grade D+";
else if((marks>=50)&&(marks<54))
cout<<"Grade D";
else
cout<<"Fail";
return 0;
}
13
PROGRAMMING FUNDAMENTALS
Program 03:
#include<iostream>
using namespace std;
int main() {
int counting;
cout << "Enter the number to show the month=";
cin >> counting;
switch(counting)
{
case 1:
cout <<" January";
break;
case 2:
cout <<"February";
break ;
case 3:
cout << "Marach";
break;
case 4:
cout << "April";
break;
case 5:
14
PROGRAMMING FUNDAMENTALS
15
PROGRAMMING FUNDAMENTALS
break;
}
return 0;
}
Program 4:
Write a program to input a number from the user the program display
weather the number divisible by 3 or not.
#include<iostream>
using namespace std;
int main()
{ int x;
cout <<"Enter a number =";
16
PROGRAMMING FUNDAMENTALS
cin >> x;
if(x%3==0)
cout <<"\n All Number is divisible by 3\n";
else
cout <<" All Number is not divisible by 3";
return 0;
}
17
PROGRAMMING FUNDAMENTALS
Program 05:
#include<iostream>
using namespace std;
int main()
{
int x,y;
cout<<"Enter number 1: ";
cin>>x;
cout<<"Enter number 2: ";
cin>>y;
if(x>=y)
cout<<"Number 1 is maximum";
else
cout<<"Number 2 is maximum";
return 0;
}
18
PROGRAMMING FUNDAMENTALS
LAB 05
Program 01:
#include<iostream>
using namespace std;
int main()
{
int inc,max=100000,min=1000;
for(int i=1;i<=10;i++)
{
cout<<"Enter"<<i<<"employee salary=";
cin>>inc;
if(max<inc)
max=inc;
if(min>inc)
min=inc;
}
cout<<"\nThe mximum salary is "<<max;
cout<<"\nThe minimum salary is "<<min;
return 0;
}
19
PROGRAMMING FUNDAMENTALS
Program 02:
#include<iostream>
using namespace std;
int main()
{
int days,choice;
cout<<"Enter the number of days= ";
cin>>days;
cout<<"What do you want?\n1.convert hours\n2.Convert into
minutes"<<endl;
cin>>choice;
switch(choice)
{
case 1:
cout<<"The hour in days"<<days*24;
break;
case 2:
cout<<"The minutes in days"<<days*24*60;
break;
}
return 0;
20
PROGRAMMING FUNDAMENTALS
Program 03:
#include<iostream>
using namespace std;
int main()
{
int a,b,c;
cout<<"ENTER first number= ";
cin>>a;
cout<<"ENTER second number= ";
cin>>b;
cout<<"ENTER third number= ";
cin>>c;
if((c>=b)&&(c>=a))
{
cout<<"The max number is "<<c<<endl;
cout<<"Te min number is "<<a;
}
else if((a>=b)&&(a>=c))
{
cout<<"The max number is "<<a<<endl;
cout<<"The min number is "<<b;
}
else
{
cout<<"The max number is "<<b<<endl;
21
PROGRAMMING FUNDAMENTALS
Program 04:
#include<iostream>
int main()
int number;
for(int x=1;x<=10;x++)
cin>>number;
if((number%5==0)||(number%2!=0))
cout<<number<<",";
22
PROGRAMMING FUNDAMENTALS
return 0;
23
PROGRAMMING FUNDAMENTALS
LAB 06
Program 01:
#include<iostream>
using namespace std;
int main()
{
int m,n,result=1;
cout<<"Enter a number= ";
cin>>m;
cout<<"how many time you want to multiple?"<<endl;
cin>>n;
for(int i=1;i<=n;i++)
{
result=result*m;
}
cout<<"Result is "<<result;
return 0;
}
24
PROGRAMMING FUNDAMENTALS
Program 02:
#include<iostream>
using namespace std;
int main()
{
int n;
cout<<"Enter a number= ";
cin>>n;
for(int i=1;i<=n;i++)
{
cout<<i<<"\t The square is "<<i*i<<endl;
}
return 0;
}
25
PROGRAMMING FUNDAMENTALS
Program 03:
#include<iostream>
using namespace std;
int main()
{
for(int x=3;x<=60;x++)
{
if(x%3==0)
cout<<x<<",";
}
cout<<" Is all the multiples of three";
return 0;
}
26
PROGRAMMING FUNDAMENTALS
Program 04:
#include<iostream>
using namespace std;
int main()
{
int row,c,n,temp;
n=5;
temp=n;
for(row=1;row<=n;row++)
{
for(c=1;c<=temp;c++)
cout<<" ";
temp;
for(c=1;c<=2*2-1;c++)
cout<<"*";
cout<<"\n";
}
return 0;
}
27