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

How can I run a C++ program directly from Windows?

How-can-I-run-a-C-program-directly-from-Windows