Create a program based on the sample output using while loop.
Enter a Number : 10
1*1 = 1
2*3 = 6
3*5 = 15
4*7 = 28
5*9 = 45
#include <stdio.h>
int main()
{
int a;
printf("Enter a Number: ");
scanf("%d", &a);
for (int i = 1; i <= a/2; i++)
{
printf("%d*%d = %d\n", i, (i*2)-1, i*((i*2)-1));
}
}
Comments
Leave a comment