PROGRAM-9


// Program to reverse a number and sum of reversed  number
#include
#include
#include
void main()
{
 int i,n,rev,sum=0;
 clrscr();
 printf("Enter a number");
 scanf("%d",&n);
 do
 {
  rev=n%10;
  printf("%d",rev);
  n=n/10;
  sum=sum+rev;
 }
 while(n!=0);
 printf("\nSum is %d", sum);
 getch();
}



Algorithm

·                     Start
·                     Declare i, n, rev, sum=0 as integer
·                      Write("the number")
·                      Read(“the number”)
·                      Do start
·                      rev=n%10
·                       Read("the reverse number”)
·                       n=n/10
·                       sum=sum+rev
·                      Do end
·                      Read("the sum”)
·                     Stop

#vpsinghrajput

Author & Editor

Has laoreet percipitur ad. Vide interesset in mei, no his legimus verterem. Et nostrum imperdiet appellantur usu, mnesarchum referrentur id vim.

0 comments:

Post a Comment