Tuesday 8 January 2013

TC c++ Chapter 1 Problem No :2

Create a code for a graphic rectangle in which user defined the values of length and width.

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

void main()
{
int a,b,c,d,e,f;
printf("Enter the lenght and width\n");
cin>>a>>b;
cout<<"\xC9";    
for(c=1;c<=a;c++)
cout<<"\xCD";
cout<<"\xBB\n";
for(d=1;d<=b;d++)
{
cout<<"\xBA";
for(e=1;e<=a;e++)
cout<<"\xCD";
cout<<"\xBA\n";
}
cout<<"\xC8";
for(f=1;f<=a;f++)
cout<<"\xCD";
cout<<"\xBC";
}



No comments:

Post a Comment

Comments please: