write a program that readsin an integer number from the keyboard. If the number
ID: 3612553 • Letter: W
Question
write a program that readsin an integer number from the keyboard. If the number isbetween 1 and 10 (inclusive), the program prints on the monitor atree of asterisks ('*') where the height of the triangle is equalto the number read from the keyboard. If the number is notbetween 1 and 10 (inclusive), the program terminates withoutprinting anything
Ex. Keyboardinput: 6
Output: *
***
*****
*******
*********
***********
Explanation / Answer
//Hope this will help you, //don't forget to rate this. #include #include int main() { int i,j,n,k; printf("Enter n:"); scanf("%d",&n); if(n< 1 || n >10 ) { printf("Not valid input "); }else { for(i=1;i=i;k--) { if(k==n) printf(" "); printf(" "); } for(j=1;jRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.