/* the code here displays the number and the corresponding asterisk but how can i make it to the point that the numbers display seperately for example 123, it should display 1* 2** 3*** */ #include <stdio.h> int histogram(int ans) { int ctr; for (ctr=1; ctr<=ans; ctr++) { printf("*"); } } int main() { int num; printf("Enter number: "); scanf("%d", &num); histogram(num); return 0; }
This post has been edited by Skydiver: 16 November 2019 - 09:45 AM
Reason for edit:: Put code in code tags. Learn to do this yourself.