WAP to print NEPAL series in C

*WAP to print the following output:

N
N E
N E P
N E P A 
N E P A L


The code goes like this: 

#include<stdio.h>
int main()
{
    char name[]="NEPAL";
    int i,j;
    for(i=0;i<=5;i++)
    {
        for(j=0;j<i;j++)
        {
        printf(" %c ",name[j]);
        }
        printf("\n");
    }
    return 0;


Output:

Share on Google Plus

About Nepali Xoro

Interested in Information Technology, Spreading Knowledge for Nepalease IT Students."Loves Traveling", Listen Music and Surfing web.
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment