Wa0109
Wa0109
Wa0109
Submitted to : MR SAKEEL
Section :C
Department :CS
Semester :1
#include<iostream>
intmain()
cout<<"Assalam O Alikum";
OUTPUT
Assalam O Alikum
#include<iostream>
cout<<"Hello World";
OUTPUT
Hello World
#include<iostream>
intmain()
OUTPUT
#include <iostream>
int main()
int hour;
{
cout << "Working Hours";
else
} }
OUTPUT
Enter Hours: 14
Working Hours
#include <iostream>
int main()
int age;
else
else
OUTPUT
Young
#include <iostream>
main()
int n;
cin>>n;
if (!(n%2 == 0))
{
cout<<"You entered an odd number\n";
else
OUTPUT
Enter a number 4
#include <iostream>
main()
s=a-b;
cout<<"Subtract ="<<s;
OUTPUT
Subtract =3
#include <iostream>
using namespace std;
main()
float r , pie=3.14;
cout<<"Enter Radius:"<<endl;
cin>>r;
cout<<"Area ="<<(r*r)*pie<<endl;
cout<<"Circumference ="<<2*pie*r<<endl;
OUTPUT
Enter Radius: 5
Area =78.5
Circumference =31.4
#include <iostream>
int main( )
int age;
cout << "Your age is: " << age << endl;
OUTPUT
Enter your age:69
Your age is 69
#include<iostream>
int main()
int a,b,c;
cin>>a;
cin>>b;
c=a+b;
Output
Your sum is 11
10
#include<iostream>
int a,b,c;
cin>>a;
cin>>b;
c=a-b;
Output
11
#include<iostream>
int main()
int a,b,c;
cin>>a;
cin>>b;
c=a*b;
Output
12
#include<iostream>
int main()
int a,b,c;
cin>>a;
cin>>b;
c=a/b;
Output
#include<iostream>
int main()
float r,b,h,l,w,PI=3.14;
cin>>r;
cout<<"Area of Circle="<<(r*r)*PI<<endl;
cin>>b>>h;
cout<<"Area of Triangle="<<b*h*0.5<<endl;
cin>>l>>w;
cout<<"Area of Rectangle="<<l*w<<endl;
Output
Enter Radius=4
Area of Circle=50.24
Area of Triangle=84
#include<iostream>
int main()
int pf=40,ict=39;
if(pf>ict)
cout<<"PF="<<pf;
else
cout<<"ICT="<<ict;
Output
PF=40
15
#include<iostream>
int main()
int pf=100,ict=69;
if(pf>ict)
{
cout<<"PF"<<pf;
else
cout<<"ICT"<<ict;
Output
PF
16
#include <iostream>
int main()
char ch;
if (isalpha(ch))
else if (isdigit(ch))
{
cout << "You entered a digit\n";
else
Output
Enter a character:g
17
#include <iostream>
int main()
char ch;
if (isalpha(ch)) {
if (isupper(ch)) {
ch = tolower(ch);
else
{
ch = toupper(ch);
else
Output
Enter a character:A
Converted character:a
18
#include <iostream>
int main()
float n,a,sum=0,0;
int i,n,count=0;
cin>>n;
for(i=1;i<=n;i++)
cout<<"Enter n"<<i<<":"<<endl;
cin>>n;
if(n<0.0)
goto jump;
sum+= n;
count++;
jump:
a=s/count;
cout<<"Average="<<a<<endl;
Output
Enter n1: 2
Enter n2: 5
Enter n3:7
Average=3.7
19
#include <iostream>
int main()
{
int n=1;
print:
cout<<n<<" ";
n++;
if(n<=5)
goto print;
Output
12345
20
#include <iostream>
int main()
cout<<"Start"<<endl;
exit(0);
cout<<"Stop"<<endl;
Output
Start
21
#include <iostream>
int main()
int n;
cout<<"Enter a Number"<<endl;
cin>>n;
if(n>10)
exit(0);
else
Output
Enter a Number 45
22
#include <iostream>
int main()
{
for(int i=0;i<=10;i++)
cout<<i<<endl;
if(i==5)
exit(0);
Output
23
#include <iostream>
int main()
{
cout << i << " ";
Output
1 3 5 7 9 11 13 15 17 19 21 23 25 27 29
24
#include <iostream>
int main()
if (i % 3 == 0)
Output
3 6 9 12 15 18 21 24 27
25
#include <iostream>
int main()
if (i % 3 == 0 && i % 5 == 0)
Output
15
26
#include <iostream>
int main()
int count;
Output
Enter a Count:10
1 9 25 49 81
27
#include <iostream>
int main()
char c;
int count = 0;
count++;
cout << "Number of non-whitespace characters entered: " << count << endl;
}
Output
28
#include<iostream.h>
void main()
cout<<y <<”\t”;
cout<< ”\n” ;
Output
12
123
29
#include<iostream.h>
#include<conio.h>
void main()
int n, k;
cin >> n;
cin >> k;
if( k%j == 0)
cout<< j <<”\t”;
Output
12346
125
30
#include<iostream>
void main()
int num, l;
char ch;
do
cin>>num;
cin>>l;
int i = 1;
while( i <= l)
cin>>ch;
while(ch!=’n’||ch!=’N’);
}
Output
9X1=9
9X2=18
9X3=27
9X4=36
9X5=45
6X1=6
6X2=12
6X3=18
6X4=24
6X5=30
«_______Thanks ________»