program to calculate the table of any number in c-programming
In this program ,we will now calculate the table of any number by using pointer in c-program by taking input from the user .
#include<stdio.h>
#include<conio.h>
void main()
{
int n,i;
int *x,*y;
x=&n,y=&i;
printf("\n enter the number:-");
scanf("%d",&n);
for(i=1;i<=10;i++){
printf("\n%d*%d=%d",*x,*y,(*x)*(*y));
}
getch();
}
#include<conio.h>
void main()
{
int n,i;
int *x,*y;
x=&n,y=&i;
printf("\n enter the number:-");
scanf("%d",&n);
for(i=1;i<=10;i++){
printf("\n%d*%d=%d",*x,*y,(*x)*(*y));
}
getch();
}
output:-

No comments:
Post a Comment