Program to print the table of natural number by using pointer in c-programming
In this program we will now taking input n natural number by the user and print table of the natural number in c-programming.
#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();
}
output:-
For more c-programming:-

No comments:
Post a Comment