Create a program based on the sample output using while loop.
Enter a Number : 10
1*2 = 2
2*4 = 8
3*6 = 18
4*8 = 32
5*10 = 50
#include <stdio.h>
int main()
{
int number, item, mult;
printf("Enter a Number: ");
scanf("%d", &number);
printf("\n");
item = 1;
while(item <= (number / 2))
{
mult = item * (item * 2);
printf("%d*%d = %d\n", item, (item * 2), mult);
item += 1;
}
}
Comments
Thank youuuuuu!!!!
Leave a comment