program of for loop , display 1 to n number and their square
#include<iostream>
using namespace std;
int main()
{ int i=1,a; cout<<"enter the number : "; cin>>a; for ( i = 1 ; i <= a; i++ ) { cout<<"\t|*__*|\t\t"<<i<<"\t\t"<<i*i<<"\t\t|*__*|\n"; } return 0;
}
No comments:
Post a Comment
thnx for visiting my blog