Program to print a No. in Reverse order and find its Sum use “do-while”loop

#include<stdio.h>
#include<conio.h>
void main()
{
   int 	num,sum=0;
   clrscr();
   printf("\nENTER NUBER=>");
   scanf("\n %d",&num);

  do
   {
     sum=sum+num;
      printf("\n revers order==%d",num);
      num--;
   }  while(num>0);
printf("\n sum===%d",sum);
getch();
}

Leave a Reply