Write a C Program to Generate the Flag of Nepal Without using Formatted I/O Function

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.


write c program to generate flag of Nepal without using formatted I O function



Write a Program to Generate the Flag of Nepal Without using Formatted I/O Function

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;
          }


Test Live At Jdoodle



Conclusion

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.

0 Comments