This Program is substantially added to understand the programming logic. The purpose of this piece of code is to learn logic building . Instead of going with hard coding just try to do it with little bit change in logic. With this logic the program will display the alphabet A.
Source Code
#include <iostream> #include <iomanip> using namespace std; void display_A(); int main() { cout<<"\t \t \t LEP Tutorials \n \n \n"; display_A(); return 0; } void display_A(){ int j=1; for(int i=13;i>0;i--){ if(i==6){ j++; cout<< setw(i-1)<<""; for(int k=0;k<j;k++){ cout<<"*"; } cout<<"\n"; j++; }else{ j++; cout<< setw(i)<<"*"<<setw(j)<<"*\n"; j++; } } }
0 comments:
Post a Comment