Rectangle using Line and Special Symbols : C Program

Computer Science » C Program » Rectangle using Line and Special Symbols

Program :

#include<stdio.h>
 
int main() 
{
   int i, j;
   for (i = 0; i < 10; i++) 
   {
      printf("n");
      for (j = 0; j < 10; j++) 
      {
         if (i == 0 || i == 9 || j == 0 || j == 9)
            printf("▲");
         else
            printf("-");
      }
   }
   return (0);
}

Output :

▲▲▲▲▲▲▲▲▲▲
▲--------▲
▲--------▲
▲--------▲
▲--------▲
▲--------▲
▲--------▲
▲--------▲
▲--------▲
▲▲▲▲▲▲▲▲▲▲
Subject Name : Computer Science
Exam Name : IIT GATE, UPSC ESE, RRB, SSC, DMRC, NMRC, BSNL, DRDO, ISRO, BARC, NIELIT
Posts Name : Assistant Engineer, Management Trainee, Junior Engineer, Technical Assistant
Computer Science Books

GATE 2023 Total InfoENGG DIPLOMAUGC NET Total Info
IES 2023 Total InfoPSUs 2022 Total InfoCSIR UGC NET Total Info
JAM 2023 Total InfoM TECH 2023 Total InfoRAILWAY 2022 Total Info

Related Posts

  • Find greatest in 3 numbers : C ProgramComputer Science » C Program » Find greatest in 3 numbers  Program : [php]#include&lt;stdio.h&gt; int main() { int a, b, c; printf(&quot;nEnter value of a, b &amp; c : &quot;); scanf(&quot;%d %d %d&quot;, &amp;a, &amp;b, &amp;c); if ((a &gt; b) &amp;&amp; (a &gt; c)) printf(&quot;na is greatest&quot;); if ((b &gt; c) &amp;&amp; (b &gt; a)) printf(&quot;nb is greatest&quot;); if ((c &gt; a) &amp;&amp; (c &gt; b)) printf(&quot;nc is greatest&quot;); return(0); }[/php] Output : [php]Enter value for a,b &amp; c : 12 16 20 c is greatest[/php]
    Tags: program, computer, science, output, programs
  • Find Average of Two Numbers : C ProgramComputer Science » C Program » Find Average of Two Numbers Program : [php]#include <stdio.h> int main() { int num1, num2; float avg; printf("nEnter first number : "); scanf("%d",&num1); printf("nEnter second number : "); scanf("%d",&num2); avg= (float)(num1+num2)/2; printf("nAverage of %d and %d is : %f",num1,num2,avg); return 0; }[/php] Output : [php]Enter first number : 5 Enter second number : 3 Average of 5 and 3 is : 4.00[/php]
    Tags: program, computer, science, output, programs
  • Inverted Pyramid : C ProgramComputer Science » C Program » Inverted Pyramid  Program : [php]#include<stdio.h> int main() { int i, j; char ch = '*'; for (i = 4; i >= 0; i--) { printf("n"); for (j = 0; j < i; j++) printf("%c", ch); } return(0); }[/php] Output : [php]**** *** ** *[/php]
    Tags: program, computer, science, output, programs
  • 1-10 Numbers in Pyramid : C ProgramComputer Science » C Program » 1-10 Numbers in Pyramid Program : [php]#include<stdio.h> int main() { int i, j; int count = 1; for (i = 0; i <= 4; i++) { printf("n"); for (j = 0; j < i; j++) { printf("%dt", count); count++; } } return(0); }[/php] Output : [php]1 2 3 4 5 6 7 8 9 10 [/php]
    Tags: program, computer, science, output, programs
  • Binary Numbers Pyramid : C ProgramComputer Science » C Program » Binary Numbers Pyramid  Program : [php]#include<stdio.h> int main() { int i, j; int count = 1; for (i = 1; i <= 5; i++) { printf("n"); for (j = 1; j <= i; j++) { printf("%d", count % 2); count++; } if (i % 2 == 0) count = 1; else count = 0; } return(0); }[/php] Output : [php]1 01 101 0101 10101[/php]
    Tags: program, computer, science, output, programs

LEAVE A REPLY

Please enter your comment!
Please enter your name here