|
0 1 2
3 4
5 6
7 8
9 10
11 12
13
14 15
16
17
18
19
20
21
22 23
24 25
26 27
28 29
30
Learn C with example
Print Star Rectangle in C
In this example we are going to explain how we can make
a star rectangle using C language.
In this example we are inserting number of rows and
columns .Then we are printing stars to make rectangle.
Source Code of Example
/* * * * *
* * * *
* * * *
* * * * print it */
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,row,col;
clrscr();
printf("Enter the row and column\t");
scanf("%d%d",&row,&col);
for(i=1;i<=row;i++)
{
for(j=1;j<=col;j++)
printf("*");
printf("\n");
}
getch();
}
|
Download Source Code
Output Of Example
| Enter the row and
column 4 4 * * * *
* * * *
* * * *
* * * * |
0 1 2
3 4
5 6
7 8
9 10
11 12
13
14 15
16
17
18
19
20
21
22 23
24 25
26 27
28 29
30
C Aptitude Questions C Interview
Questions And Answers
C Objective Interview Questions And
Answers(10)
C Subjective Interview Questions And
Answers(100)
C
syntax, semantics and simple programming questions(61)
C Interview Questions And Answers( Objective and Subjective)
|