Wednesday, 17 February 2016

Program To Print "H" in C++

"""Nice One Program"""


Here is The Program To GiveYou The About

How To Print "H"  On the Screen.  User Will Enter The Value .And According to that

H will be Printed On the Screen

CODE:


#include<iostream.h>
#include<conio.h>

void main()
{ int n,i,j;     clrscr();

  cout<<"Enter The Number:";
  cin>>n;
  for(i=1;i<=3*n;i++)
{  for(j=1;j<=3*n;j++)

  if(j<=n||j>2*n)
  cout<<"*";
  else
  {if(i<=n||i>2*n)
   cout<<" ";
   else
  cout<<"*"; }
  cout<<endl;
  }

  getch();

  }





Add caption








No comments:

Post a Comment