Wednesday, 20 March 2019

CP: Pattern Display - 3

Que: Write a C program to display the following different Patterns.
A
B  C
D  E  F


Code: 

#include <stdio.h>
int main()

{
    int i, j;
    char alphabet='A';
    for(i=1;i<=3;i++)
    {

  for(j=1;j<=i;j++)
        {
            printf("%c ",alphabet);
            alphabet++;
        }

        printf(" ");
        printf(" \n");
    }

    return 0;

}



No comments:

Post a Comment

LAB 7 Arduino with Seven Segment Display || Arduino Tutorial || Code and Circuit Diagram || Project

  LAB 7 Arduino with Seven Segment Display || Arduino Tutorial || Code and Circuit Diagram || Project Dear All We will learn how to Connec...