Monday, 9 July 2018

Table Print in C Language


Information Of This Program:-
Table Print in C Language First Of all in this Program table Print fist Header file stdio.h include then start the main function then two variable declared a and b then user enter a number   then for loop start table we need to iterate from 1 to 5. Run a loop from 1 to 15, increment 1 on each iteration. The loop structure should look like for(b=1; b<=5; b++).
CODE:-
#include <stdio.h>
int main()
{
int a, b;
printf("Enter an integer: ");
scanf("%d",&a);
for(b=1; b<=5; b++)
{
printf("%d * %d = %d \n", a,b, a*b);
}
return 0;
}
OUTPUT:-
Enter an integer:5
5*1=5
5*2=10
5*3=15
5*4=20
5*5=25

No comments:

Post a Comment

Thanks for comment