0% found this document useful (0 votes)
12 views4 pages

1a-002-Lab 7

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views4 pages

1a-002-Lab 7

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Name : Mohammad Dawood Section: BS.

SE (1-A)

Roll no. : SU-92-BSSEM-F23-002

TASK #01:
#include<iostream>
using namespace std;
int main(){
int num,i;

int factorial;
cout<<"enter the number you find factorial of = ";
cin>>num;
factorial=1;
for(int i=1;i<=num;i++){
factorial=factorial*i;
}
cout<<"factorial is ="<<factorial<<endl;
return 0;
}

TASK #04:
#include <iostream>
using namespace std;
int main() {
int number;
int multiple=0;
cout<<"Enter the number :";
cin>>number;
for(int i=13 ; i<=number ; i=i+13){
multiple++;
}
cout<<"number of multiples of 13 found between o and number is "<<multiple<<endl;
return 0;
}

TASK #02:
#include<iostream>
using namespace std;
int main(){
int num,count=0,sentinel=-111;
cout<<"Enter the number :";
cin>>num;
while(num!=sentinel){
count++;
cin>>num;
}
cout<<"count="<<count<<endl;
return 0;
}

TASK #03:
#include<iostream>
using namespace std;
int main(){
int num;
int count=0;
int sentnential=-1;
int sum=0;
double mean;
cout<<"enter the number"<<endl;
cin>>num;
while(num!=sentnential){
count++;
sum=sum+num;
cin>>num;
}
mean=sum/count;
cout<<"the mean is "<<sum/mean<<endl;
return 0;
}

You might also like