Friday, 9 September 2016

11 C practical 9 given no. is palindrome or not algorithm

ALGORITHM
Input
1.num
Output
1.rev
Method
1.start
2.read num
3.write num
4. n=num, rev=0


5. do
    { r=n%10;

      rev=(rev*10)+r;

      n=n/10;
     }while(n!=0)
6.if(num==rev)
7. write given number is palindrome
8. else
9. write given number is not palindrome
10 stop


No comments:

Post a Comment