how can u draw a rectangle in C

Answer Posted / rakesh

#include<stdio.h>
#define n 5
#define m 4
int main()
{ int i,j;
printf("%c",218);
for(i=1;i<=n;i++)
printf("%c",196);
printf("%c",191);
for(i=1;i<=m;i++)
{ printf("\n%c",179);
for(j=1;j<n;j++)
printf(" ");
printf(" %c",179);
}
printf("\n%c",192);
for(i=1;i<=n;i++)
printf("%c",196);
printf("%c",217);
getch();
return(0);
}
you can change the dimensions by changing n and m.

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

To Write a C program to remove the repeated characters in the entered expression or in entered characters(i.e) removing duplicates. String contains only lowercase characters ['a'-'z']

493


Set up procedure for generating a wire frame display of a polyhedron with the hidden edges of the object drawn with dashed lines

3026


Design an implement of the inputs functions for event mode

2957


can you use proc sql to manpulate a data set or would u prefer to use proc report ? if so why ? make up an example and explain in detail

2325


What is the match merge ? compare data step match merge with proc sql merge - how many types are there ? data step vs proc sql

2402






how to test pierrot divisor

2255


write a simple calculator c program to perform addition, subtraction, mul and div.

3143


Develop a routine to reflect an object about an arbitrarily selected plane

2992


how to create a 3x3 two dimensional array that will give you the sums on the left and bottom columns

3117


What is full form of PEPSI

1862


Write a program to model an exploding firecracker in the xy plane using a particle system

3686


write a program for area of circumference of shapes

2028


Write a Program in 'C' To Insert a Unique Number Only. (Hint: Just Like a Primary Key Numbers In Database.) Please Some One Suggest Me a Better Solution for This question ??

1768


how to programme using switch statements and fuctions, a programme that will output two even numbers, two odd numbers and two prime numbers of the users chioce.

2136


Can you send Code for Run Length Encoding Of BMP Image in C Language in linux(i.e Compression and Decompression) ?

3843