Program to print table of Given No. & find Sum

#include<stdio.h>
#include<conio.h>
void main()
{
   int i=1,res,num,sum=0;
   clrscr();
   printf("\n ENTER NUMBER=>");
   scanf("%d",&num);
   while(i<=10)
   {
      res=num*i;
      sum=sum+res;
      printf("\n NUMBER=>%d",res);
     i++;
   }
   printf("\n result sum=%d",sum);

getch();

}

Leave a Reply