Pattern:1*1=1 2*2=4 3*3=9 4*4=16
Write a program to print
1*1=1
2*2=4
3*3=9
4*4=16
5*5=25
#include<stdio.h>
main()
{
int i=1,n;
printf("\n\tEnter the range value:");
scanf("%d",&n);
printf("\nThe pattern is:\n");
while(i<=n)
{
printf("%d * %d=%d\n",i,i,i*i);
i++;
}
}
No comments:
Post a Comment