Beruflich Dokumente
Kultur Dokumente
150896@student.au.edu.pk
Air University, Islamabad
Department of Computer Science
Computer Programming
22dWeek Worksheet
..
My Name is
-------
Co
#include <iostream>
using namespace std;
Cod
#include <iostream>
using namespace std;
return 0;
}
return 0;
}
int main() {
b):
*
***
*****
*******
*********
*
***
*****
Code:
Code:
#include <iostream>
using namespace std;
int main() {
cout<<"*"<<endl;
cout<<"***"<<endl;
cout<<"*****"<<endl;
cout<<"*******"<<endl;
cout<<"*********"<<endl;
return 0;
#include <iostream>
using namespace std;
int main() {
cout<<"
*"<<endl;
cout<<"
***"<<endl;
cout<<"
*****"<<endl;
cout<<" *******"<<endl;
cout<<"*********"<<endl;
return 0;
}
c):
Write C++ Programs to show the following using cout Statement:
********
********
********
* * *
* * * * *
Cod
Code:
#include <iostream>
using namespace std;
#include <iostream>
using namespace std;
int main() {
int main() {
cout<<" * "<<endl;
cout<<" *** "<<endl;
cout<<"***** "<<endl;
cout<<" *** "<<endl;
cout<<" * "<<endl;
cout<<"********"<<endl;
cout<<"********"<<endl;
cout<<"********"<<endl;
return 0;
}
return 0;
}
d):
Write C++ Programs to show the following using cout Statement:
Main Manu
_____________
1. Option 1
2. Option 2
3. Option 3
*************
* Welcome
*
Code:
Code:
#include<iostream>
Using namespace std;
#include <iostream>
using namespace std;
int main() {
int main() {
cout<<"*************"<<endl;
cout<<"Main Menu"<<endl;
cout<<"*
WELCOME
*"<<endl;
cout<<"_________"<<endl;
cout<<"*************"<<endl;
cout<<"1.Option1"<<endl;
cout<<"2.Option2"<<endl;
cout<<"3.Option3"<<endl;
return 0;
return 0;
}
Write a program which takes input of one value from user, identify if the
value entered
Code:
#include <iostream>
using namespace std;
int main() {
int value;
cout<<"enter value : "<<endl;
cin>>value;
if(value>0)
{
cout<<"value is positive"<<endl;
}
else
{
cout<<"value is negative"<<endl;
}
return 0;
}
Subjectbscs-B-ID-Name-LabWeek-02
Send:
cs.ahsan.shehzad@gmail.com