Practice problems
Example 1: Write a program to display 60,54,48 to 6 ??
Answer : #include <iostream.h>
#include <conio.h>
void main()
{
Clrscr();
int i;
i=60;
While(i>=6)π condition
{
Cout<<i<<endl;
i-=6;
}
getch() ;
}
Example 2: Write a program to display 10000,9900,to 10 ??
Answer : #include <iostream.h>
#include <conio.h>
void main()
{
Clrscr();
int i;
i=10000;
While(i>=10)π condition
{
Cout<<i<<endl;
i-=10;
}
getch() ;
}
Example 3: Write a program to display 'A' to 'T' ??
Answer : #include <iostream.h>
#include <conio.h>
void main()
{
Clrscr();
char i;
i='A';
While(i<='T')π condition
{
Cout<<i<<endl;
i++;
}
getch() ;
}
Example 4: Write a program to display 'a' to 'z' ??
Answer : #include <iostream.h>
#include <conio.h>
void main()
{
Clrscr();
char i;
i='a';
While(i<='z')π condition
{
Cout<<i<<endl;
i++;
}
getch() ;
}
Example 5: Write a program to display a,c,e to w ??
Answer : #include <iostream.h>
#include <conio.h>
void main()
{
Clrscr();
char i;
i='a';
While(i<='w')π condition
{
Cout<<i<<endl;
i+=2;
}
getch() ;
}
Example 6: Write a program to display 1,4,9 to 100 ??
Answer : #include <iostream.h>
#include <conio.h>
void main()
{
Clrscr();
int i;
i=1;
While(i<=100)π condition
{
Cout<<i<<endl;
i+=3;
}
getch() ;
}
Example 7: Write a program to display 1,8,27 to 100 ??
Answer : #include <iostream.h>
#include <conio.h>
void main()
{
Clrscr();
int i;
i=1;
While(i<=10)π condition
{
Cout<<i*i<<endl;
i++;
}
getch() ;
}
Example 8: Write a program to display 100,81,64 to 1 ??
Answer : #include <iostream.h>
#include <conio.h>
void main()
{
Clrscr();
int i;
i=10;
While(i>=1)π condition
{
Cout<<i*i<<endl;
i--;
}
getch() ;
}
π
IF you want to know how to display any string or anything in C++ then CLICK HERE
π IF you want to know How to solve Complex type of mathematical Problem in C++
π IF you want to know How to calculate percentage in C++ Programming CLICK HERE
π IF you want to know How to use mathematical operator in c++ CLICK HERE
π what is shortend operators and how to use it in program CLICK HERE what
Our website:
π https://codemasternisha.blogspot.com/π
if you face any any problem or any issue about our website then fill the contact us page and write your issues in it ...
πππππππππππππ
KEEP SUPPORTING π !! KEEP LEARNING π !!
πππππππ
0 Comments