Loops in C++
(While Loop)
Q1. write a program in C++. your program should print all the Even numbers from 0-100 on the console screen?
Q2. write a program in C++. your program should print A-Z on the console?
Q3. write a program in C++. your program should print the Multiple of 3 from 0-100 range on the console?
Q4. write a program in C++ print "All Good" infinite time on the console?
For help:
Submission:
Question # 1
ReplyDelete#include
using namespace std;
void main()
{
int a=0;
while(a<=100)
{
if(a%2==0)
{
cout<<a<<endl;
}
a++;
}
system("pause");
}
Muhammad Bilal
Section A2
CMS # 406670
Question # 2
ReplyDelete#include
using namespace std;
void main()
{
char ch='A';
while(ch<='Z')
{
cout<<ch<<endl;
ch++;
}
system("pause");
}
Muhammad Bilal
Section A2
CMS # 406670
#include
ReplyDeleteusing namespace std;
int main()
{
int a=0;
while(a<=100)
{
if(a%2==0)
{
cout<<a<<endl;
}
a++;
}
system("pause");
return 0;
}
Name :Muhammad Wasif Nazir
class :section A1
cms no406084.
Question # 4
ReplyDelete#include
using namespace std;
void main()
{
while( 1&& (1||(-100)))
{
cout<<"Good"<<endl;
}
system("pause");
}
Muhammad Bilal
Section A2
CMS # 406670
Question 2
ReplyDelete#include
using namespace std;
int main()
{
char ch='A';
while(ch<='Z')
{
cout<<ch<<endl;
ch++;
}
system ("pause");
return 0;
}
Name:Muhammad Wasif Nazir
class:section A1
cms no.406084
Question # 3
ReplyDelete#include
using namespace std;
void main()
{
int a=0;
while(a<=100)
{
if(a%3==0)
{
cout<<a<<endl;
}
a++;
}
system("pause");
}
Muhammad Bilal
Section A2
CMS # 406670
question 3
ReplyDelete#include
using namespace std;
int main()
{
while(a<=100)
{
if(a%3==0)
{
cout<<a<<endl;
}
a++;
}
system("pause");
return 0;
}
Name :muhammad wasif nazir.
class :section A1
cms no:406084
Question 4
ReplyDelete#include
using namespace std;
int main()
{
while( 1&& (1||(-100)))
{
cout<<"Good"<<endl;
}
system("pause");
return 0;
}
name :Muhammad wasif nazir
class :section A1
cms no:406084
#include
ReplyDeleteusing namespace std;
void main()
{
int a=0;
while(a<=100)
{
if(a%2==0)
{
cout<<a<<endl;
}
a++;
}
system("pause");
}
ALI HASNAIN
CMS 405643
question 2
#include
using namespace std;
void main()
{
char ch='A';
while(ch<='Z')
{
cout<<ch<<endl;
ch++;
}
system("pause");
}
ali hasnain
cms 405643
#include
ReplyDeleteusing namespace std;
int main()
{
while( 1&& (1||(-100)))
{
cout<<"Good"<<endl;
}
system("pause");
return 0;
}
ali hasnain
cms 405643
saction a1
Q#1:
ReplyDelete#include
using namespace std;
void main()
{
int num=0;
cout<<"The even numbers between 0 to 100 is:"<<"\n";
while(num>=0 && num<=100)
{
cout<<num<<"\n";
num+=2;
}
system("pause");
}
Sarmad Hassan
CMS#406324
Section:A2
Q no:1
ReplyDelete#include
using namespace std;
void main()
{
int a=0;
cout<<"the even numbers between 0 to 100 is:"<<"\n";
while(a>=0 && a<=100)
{
cout<<a<<"\n";
a=a+2;
}
system("pause");
}
Abdul Rehman
Cms:406311
Question No 1:
ReplyDelete#include
using namespace std;
void main()
{
int a=0;
cout<<"All even numbers from 0-100"<<"\n";
while(a>=0 && a<=100)
{
cout<<a<<"\n";
a=a+2;
}
system("pause");
}
Madni Fareed
CMS#406323
#include
ReplyDeleteusing namespace std;
int main()
{
int s=0;
cout<<"the even numbers between 0 to 100"<<"\n";
while(s<=100 && s>=0)
{
cout<<s<<"\n";
s=s+2;
}
system("pause");
return 0;
}
Saim Bashir
406979
A2
Q#2:
ReplyDelete#include
using namespace std;
void main()
{
char alpha='A';
cout<<"The A-Z alphabets are:"<<"\n";
while(alpha>=65 && alpha<=90)
{
cout<<alpha<<"\n";
alpha++;
}
system("pause");
}
Sarmad Hassan
CMS#406324
Section:A2
Q no:2
ReplyDelete#include
using namespace std;
void main()
{
char alpha='A';
cout<<"the A-Z alphabets are:"<<"\n";
while(alpha>=65 && alpha<=90)
{
cout<<alpha<<"\n";
alpha++;
}
system("pause");
}
Abdul Rehman
CMS:406311
A2
Q#3:
ReplyDelete#include
using namespace std;
void main()
{
int num=3;
cout<<"The multiple of 3 between 0 to 100 are:"<<"\n";
while(num>=3 && num<=100)
{ cout<<num<<"\n";
num+=3;
}
system("pause");
}
Sarmad hassan
CMS#406324
Section:A2
Question No:2
ReplyDelete#include
using namespace std;
void main()
{
char a=65;
cout<<"All characters from A-Z"<<"\n";
while(a>=65 && a<=90)
{
cout<<a<<"\n";
a++;
}
system("pause");
}
Madni Fareed
CMS#406323
Section : A2
#include
ReplyDeleteusing namespace std;
int main()
{
char a=65;
cout<<"all character from A-Z"<<"\n";
while(a>=65 && a<=90)
{
cout<<a<<"\n";
a++;
}
system("pause");
return 0;
}
Saim Bashir
406979
A2
Q no:3
ReplyDelete#include
using namespace std;
void main()
{
int num=3;
cout<<"the multiple of 3 between 0 to 100 are:"<<"\n";
while(num>=3 && num<=100)
{
cout<<num<<"\n";
num+=3
}
system("pause");
}
Abdul Rehman
CMS:406311
A2
Q#4:
ReplyDelete#include
using namespace std;
void main()
{
while(1&&1)
{
cout<<"All Good"<<"\n";
}
system("pause");
}
Sarmad Hassan
CMS#406324
Section:A2
Question No:3
ReplyDelete#include
using namespace std;
void main()
{
int x=3;
cout<<"The Multiple of 3 from 0-100="<<"\n";
while(x>=3 && x<=100)
{
cout<<x<<"\n";
x=x+3;
}
system("pause");
}
Madni Fareed
CMS#406323
Section : A2
#include
ReplyDeleteusing namespace std;
int main()
{
int a=3;
cout<<"the multiple of 3 from 0 to 100"<<"\n";
while(a>=3 && a<=100)
{
cout<<a<<"\n";
a=a+3;
}
system("pause");
return 0;
}
Saim Bashir
406979
A2
Q no:4
ReplyDelete#include
using namespace std;
void main()
{
while(1&&1)
{
cout<<all good"<<"\n";
}
system("pause");
}
Abdul Rehman
CMS:406311
A2
Question No:4
ReplyDelete#include
using namespace std;
void main()
{
while(1)
{
cout<<"All Good";
}
system("pause");
}
Madni Fareed
CMS#406323
Section: A2
Q1. write a program in C++. your program should print all the Even numbers from 0-100 on the console screen?
ReplyDelete#include
using namespace std;
void main()
{
int a = 0;
while (a <= 100)
{
cout << a << "\n";
a = a + 2;
}
}
Q2. write a program in C++. your program should print A-Z on the console?
#include
using namespace std;
void main()
{
char a = 'A';
while (a <= 'Z')
{
cout << a << "\n";
a++;
}
}
Q3. write a program in C++. your program should print the Multiple of 3 from 0-100 range on the console?
#include
using namespace std;
void main()
{
int a = 1
;
while (a <= 100)
{
cout <<"multiple of 3 = " << a << "\n";
a=a*3;
}
}
Q4. write a program in C++ print "All Good" infinite time on the console?
#include
using namespace std;
void main()
{
int a = 1;
while (a != 100)
{
cout << "ALL GOOD " << "\n";
}
}
Name; FAIZAN AHMAD
CMS;406201
A2
#include
ReplyDeleteusing namespace std;
int main()
{
while(1)
{
cout<<"all Good";
}
system("pause")
return 0 ;
}
saim bashir
406979
A2
Q1. write a program in C++. your program should print all the Even numbers from 0-100 on the console screen?
ReplyDelete#include
using namespace std;
void main()
{
int a = 0;
while (a <= 100)
{
cout << a << "\n";
a = a + 2;
}
}
Q2. write a program in C++. your program should print A-Z on the console?
#include
using namespace std;
void main()
{
char a = 'A';
while (a <= 'Z')
{
cout << a << "\n";
a++;
}
}
Q3. write a program in C++. your program should print the Multiple of 3 from 0-100 range on the console?
#include
using namespace std;
void main()
{
int a = 1
;
while (a <= 100)
{
cout <<"multiple of 3 = " << a << "\n";
a=a*3;
}
}
Q4. write a program in C++ print "All Good" infinite time on the console?
#include
using namespace std;
void main()
{
int a = 1;
while (a != 100)
{
cout << "ALL GOOD " << "\n";
}
}
name:laiq ahmed
cms :406985
A2
#include
ReplyDeleteusing namespace std;
int main()
{
int x=0;
while (x<=100)
{
if(x%2==0)
{
cout << x <<endl;
}
x=x+1;
}
system("pause");
}
MUHAMMAD UMAIR ANJUM
CMS NO: 406266
SECTION A2
#include
ReplyDeleteusing namespace std;
int main()
{
char ch='A';
while (ch<='Z')
{
cout << ch << endl;
ch=ch+1;
}
system ("pause");
}
MUHAMMAD UMAIR ANJUM
CMS NO: 406266
SECTION A2
#include
ReplyDeleteusing namespace std;
int main()
{
int x=0;
while (x<=100)
{
if(x%3==0)
{
cout << x << endl;
}
x=x+1;
}
system("pause");
}
MUHAMMAD UMAIR ANJUM
CMS NO: 406266
SECTION A2
#include
ReplyDeleteusing namespace std;
int main()
{
while (1 && (1||(-100)))
{
cout << "GOOD" <<endl;
}
}
MUHAMMAD UMAIR ANJUM
CMS NO: 406266
SECTION A2
#include
ReplyDeleteusing namespace std;
int main()
{
int a=0;
while(a<=100)
{
if(a%2==0)
{
cout<<a<<endl;
}
a++;
}
system("pause");
return 0;
}
Ijaz Ali Shah
A1
CMS 407261
#include
ReplyDeleteusing namespace std;
int main()
{
char ch = 'A';
while (ch <= 'Z')
{
cout << ch << endl;
ch++;
}
system("pause");
return 0;
}
Ijaz Ali shah
Section:A1
CMS:407261
#include
ReplyDeleteusing namespace std;
int main()
{
int a = 0;
while (a <= 100)
{
if (a % 3 == 0)
{
cout << a << endl;
}
a++;
}
system("pause");
}
Ijaz Ali shah
Section :A1
CMS: 407261
Post a Comment