Monday, July 2, 2018

C program to draw a Digonal of entered numbre

#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <limits.h>
#include <stdbool.h>

void staircase(int n) {
   
    char c='#';


        for(int j=n;j>0;j--)
      { printf("%*c\n",j,c);

      }


}

int main() {
    int n;
    scanf("%i", &n);
    staircase(n);
    return 0;
}

No comments:

Post a Comment

Sacred Thought

5 May 2024 Hari Om Verse 50-51, chapter two:  In this chapter two Shree krishna explains a simple way of living. Free from desires and void ...