ASSIGNMENT (Mini)
ASSIGNMENT (Mini)
ASSIGNMENT (Mini)
PROGRAMMING
FUNDAMENTALS
Submitted By:
Sidra Bashir
BT 15012
Submitted To:
Sir Irfan Ahmed
//PROGRAM 1 R.BT15012 N.B.Sidra S.A.M
#include<iostream.h>
#include<conio.h>
void main(){
clrscr():
int arr[5];
cin>>arr[0];
cin>>arr[1];
cin>>arr[2];
cin>>arr[3];
cin>>arr[4];
getch();
clrscr();
cout<<" "<<arr[0]<<endl;
cout<<" "<<arr[1]<<endl;
cout<<" "<<arr[2]<<endl;
cout<<" "<<arr[3]<<endl;
cout<<" "<<arr[4]<<endl;
cout<<endl;
getch();}
#include<iostream.h>
#include<conio.h>
void main(){
clrscr();
int arr[5],i;
{
cout<<" Enter an integer : ";
cin>>arr[i];
cout<<" "<<arr[i]<<endl;
getch();
}
//PROGRAM 3 R.BT15012 N.B.Sidra S.A.M
#include<iostream.h>
#include<conio.h>
void main()
clrscr();
int arr[5],i,sum=0;
float avg;
cin>>arr[i];
sum=sum+arr[i];
avg=sum/5.0;
getch();}
//PROGRAM 4 R.BT15012 N.B.Sidra S.A.M
#include<iostream.h>
#include<conio.h>
void main()
clrscr();
int day,i,total,month;
int days_per_month[12]={31,28,31,30,31,30,31,31,30,31,30,31};
cin>>month;
cin>>day;
total=day;
total=total+days_per_month[i];
getch();
#include<iostream.h>
#include<conio.h>
void main(){
clrscr();
int age[100],i,n,count=0;
cin>> n;
cout<<" ";
cin>>age[i];
count=count+1;}
getch();
#include<conio.h>
void main(){
clrscr();
int numbers[size];
int squares[size];
int cubes[size];
int sum[size];
int i,total=0;
numbers[i]=i;
squares[i]=i*i;
cubes[i]=i*i*i;
sum[i]=numbers[i]+squares[i]+cubes[i];}
cout<<" **************************************************"<<endl;
cout<<numbers[i]<<"\t";}
cout<<squares[i]<<"\t";
cout<<cubes[i]<<"\t";}
cout<<sum[i]<<"\t";
total=total+sum[i];}
cout<<" **************************************************"<<endl;
getch();
#include<iostream.h>
#include<conio.h>
void main()
clrscr();
int arr[10],i,max;
cin>>arr[i];}
max=arr[0];
max=arr[i];}
getch();}
#include<iostream.h>
#include<conio.h>
void main()
clrscr();
int arr[10],i,min;
cin>>arr[i];
min=arr[0];
min=arr[i];
getch();
}
//PROGRAM 9 R.BT15012 N.B.Sidra S.A.M
#include<iostream.h>
#include<conio.h>
void main()
clrscr();
int arr[5],i,num;
{
cout<<" Enter a number = ";
cin>>arr[i];}
cout<<arr[i]<<" ";}
cout<<arr[i]<<" ";
getch();}
#include<iostream.h>
#include<conio.h>
void main()
clrscr();
int arr[10]={10,20,30,40,50,60,70,80,90,100};
int i,n,loc=-1;
cin>>n;
if(arr[i]==n)
loc=i;
if(loc==-1)
else
cout<<" ********************************"<<endl;
getch();
}
//PROGRAM#11 R.BT15012 N.BT15012 S.A.M
#include<iostream.h>
#include<conio.h>
void main()
clrscr();
cout<<endl<<endl;
cout<<" AND THEN DISPLAYING HOW MANY ARE ABOVE FIFTY "<<endl;
cout<<"******************************************************************"<<endl<<endl;
int n,i,age[500],count=0;
cin>>n;
for(i=0;i<n;i++)
if(age[i]>50)
count++;
cout<<"*******************************************************************";
getch();
#include<iostream.h>
#include<stdlib.h>
#include<conio.h>
void main()
clrscr();
int b_date,b_month,b_year;
int c_date,c_month,c_year;
int b_arr[12]={31,28,31,30,31,30,31,31,30,31,30,31};
int c_arr[12]={31,28,31,30,31,30,31,31,30,31,30,31};
int total,current_days,umr,age,child,i,j,old,y,count=0;
cout<<"***************************************"<<endl<<endl;
getch();
exit(0);}
cin>>b_month;
getch();
exit(0);
cin>>b_year;
cin>>c_date;
cin>>c_month;
cin>>c_year;
old=b_date-1;
for(i=0;i<b_month-1;i++)
old+=b_arr[i];
child=365-old;
age=c_year - b_year - 1;
for(y=b_year;y<=c_year;y++)
if(y%4==0)
count++;
umr=365*age;
current_days=c_date-1;
for(j=0;j<c_month-1;j++)
current_days+=c_arr[i];
total=current_days+umr+child+count;
cout<<"___________________________________________"<<endl<<endl;
cout<<"You Have Spend : " << total << " Days till Now."<<endl;
cout<<"___________________________________________"<<endl;
getch();}
//PROGRAM#13 R.BT15012 N.B.SIDRA S.A.M
#include<iostream.h>
#include<conio.h>
void main()
clrscr();
cout<<endl<<endl;
cout<<"******************************************************************"<<endl<<endl;
int n,i,age[500],count1=0,count2=0,count3=0,count4=0;
cin>>n;
for(i=0;i<n;i++)
cin>>age[i];
if(age[i]>=45)
count1++;
else if(age[i]>=20&&age[i]<=44)
count2++;
else if(age[i]>=13&&age[i]<=19)
count3++;
else
count4++;
clrscr();
cout<<"******************************************************************"<<endl<<endl;
getch();