star pattern to print right angled triangle in C language with user defined row and colums | (star pattern code 2) | (Program 16)

 /* Made by Anmol main

student B.tech CSE

Punjabi university

Program 16 */


#include<stdio.h>

int main()

{int i,j,a,b;

    printf("Enter the number of rows\n");

    scanf("%d",&a);

    printf("Enter the number of colums\n");

    scanf("%d",&b);

    for(i=0;i<a;i++)

    { printf("\n");

        for (j=0;j<b;j++)

        {

            if (i>=j)

            {printf("* "); }

            else

            printf(" ");


        }

    }

}

Comments

Popular posts from this blog

Glowing-Log-in-window-in-Pure-html-css #30

Program to swap 2 numbers by using 3 numbers, taking input from user in C language. #1

C program to print lengh of an array (program 20)