C Program to print table of a given number using for loop
// C Program to print table of a given number using for loop:-
#include <stdio.h>
#include<conio.h>
void main()
{
int n, i;
clrscr();
printf("Enter an integer: ");
scanf("%d",&n);
for(i=1;
i<=10; i++)
{
printf("%d
* %d = %d \n", n, i, n*i);
}
getch();
}
================
Output:-
Enter an integer: 8
8 * 1 = 8
8 * 2 = 16
8 * 3 = 24
8 * 4 = 32
8 * 5 = 40
8 * 6 = 48
8 * 7 = 56
8 * 8 = 64
8 * 9 = 72
8 * 10 = 80
===============
Comments
Post a Comment