Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
print 5 numbers and return corresponding asterisks - C program
once more i need you help! I need to write a C program that imputs 5 numbers between 1 and 30 and returns the corresponding number of adjacent asterisks. I cannot use neither the do...while nor the array functions because i haven't studied them yet.
I have tried varius combinations like the for loop followed by nested if statements to test if the numbers are included between 1 and 30,but it doesn't work.
I don't get how to connect the testing part with the printing of the asterisks.
I don't want you to do my homework, i would only like you to give me some hints on how to proceed after the for loop statement.
Here is what i have (just the beginning,i know...):
int main( void ) /* function main begins program execution */
int num1, num2, num3, num4, num5, x;
printf( "Enter five numbers between 1 and 30:" );
scanf_s( "%d%d%d%d%d", num1, num2, num3, num4, num5 );
for ( x = 1; x <= 5; x++ );
Thank you in advance for your help,
0 · ·