Print 1 to 10 and multiply it to 1 to 20 even numbers using while loop in c.
Sample Output :
1 * 2 = 2
2 * 4 = 8
3 * 6 = 18
4 * 8 = 32
5 * 10 = 50
6 * 12 = 72
7 * 14 = 98
8 * 16 = 128
9 * 18 = 162
10 * 20 = 200
#include <stdio.h>
int main() {
int x = 1;
int y = 2;
while(x <= 10) {
printf("%d * %d = %d\n", x, y, x*y);
x = x + 1;
y = y + 2;
}
return 0;
}
Comments
Leave a comment