C++ program to print Z to A using do..while loop.
#include<iostream>
using namespace std;
int main()
{
char ch='Z';
do
{
cout << ch;
ch = ch - 1;
}
while(ch >= 'A');
return 0;
}
Output of program
ZYXWVUTSRQPONMLKJIHGFEDCBA
#include<iostream>
using namespace std;
int main()
{
char ch='Z';
do
{
cout << ch;
ch = ch - 1;
}
while(ch >= 'A');
return 0;
}
Output of program
ZYXWVUTSRQPONMLKJIHGFEDCBA
No comments:
Post a Comment