hi,
there...ive come up with these codes and they work.but i dont know how to modify the program so that it prints sequence of asterisks in a single line based on the input gained using :
1.while
2.do-while
3.for
please help...
#include <stdio.h>
int main()
{
int x;
printf("Enter an integer\n");
scanf("%d", &x);
if((x<=20)&&(x>0))
{
}
else
{
printf("You have entered an invalid integer.Please enter a number smaller or equals to 20");
}
while((x>20)||(x<=0)){
printf("\nEnter a valid integer \n");
scanf("%d",&x);
}
printf("valid");
return 0;
}