In this tutorial learn how you can generate the flag of Nepal without using formatted I/O function. Here we are generating with the star pattern.
You need to generate the following output.
*
**
***
****
*****
*
**
***
****
*****
*
*
C programming is a powerful general-purpose programming language. It can be used to develop software like operating systems, databases, compilers, etc.
Here is the code to generate the flag of Nepal without using formatted I/O function in C programming.
#include <stdio.h> /* Generate the following output without using formatted I/O function.
*
**
***
****
*****
*
**
***
****
*****
*
*
*/
int main(){
int i,j;
for ( i = 1; i <=5; i++)
{
for ( j = 1; j <= i; j++)
{
putchar('*');
}
putchar('n');
}
for ( i = 1; i <=5; i++)
{
for ( j = 1; j <= i; j++)
{
putchar('*');
}
putchar('n');
}putchar('*');
putchar('n');
putchar('*');
return 0;
}
This is how you can generate the flag of Nepal without using formatted I/O function in C programming. Comment below if you like our tutorial.