Computer Science, asked by gai, 1 year ago

how to insert a rectange box in c programming?

Answers

Answered by Yasmin
1
║#include<graphics.h>║#include<conio.h>║main()║{║int gd=DETECT,gm;║initgraph(&gd,&gm,"C:\\TC\\BGI");║rectangle(100,100,200,200);║getch();║closegraph();║return 0;║}

Yasmin: This is how to insert a rectangle in c programming
kopal: good
Yasmin: Thank you
kopal: wlcm
Answered by manuhisenheim
0
#include <stdio.h> 
main (void)
{
int width, height, i, j;
printf("Enter the width of the rectangle.\n");
scanf("%d", &width);         
printf("Enter the height of the rectangle.\n");
    
scanf("%d", &height);
     
for(i = 0; i < width; i++)
   
 {  
  
  printf("*");   
 }
  
   printf("\n");
 
 for(i = 0; i < (height-2); i++)    
{   
        
printf("*");
                 
for(j = 0; j < (width-2); j++)
        
{
            
printf(" ");
        
}
                 
printf("*");
        
 printf("\n");
   
 }
           
for(i = 0; i < width;   i++)
    
{
  
printf("*");
   
 }
        
 printf("\n");
         
system("PAUSE");
    
return 0;
}
Similar questions