Friday, July 27, 2018

Programming in C Example. Pattern program

This is my first program.Example with output screenshot .

#include <stdio.h>
int main()
{
    int i, j, row;

    printf("Enter any number of row: ");
/* Here i entered the number of 5 and the output in the screen see below */
    scanf("%d",&row);

    for(i=1; i<=row; ++i)
    {
        for(j=1; j<=i; ++j)
        {
            printf("%d ",j);
        }
        printf("\n");
    }
    return 0;
}


Output:

No comments:

Post a Comment

C program for find square value

This is an example of how to find square value of a number using function.  #include<stdio.h> float square ( float x ); int ma...