-->
Wednesday, June 29, 2022
Add all the digits of a number | C Program
FindError
Home
Catagories
C Programs
C Graphics
Python Programs
About
contact
Home
About
Contact
Python Programs
Swapping using 3rd variable
Swpping without using 3rd variable
Even or Odd check
Add all digits of a number
Add all Even and Odd digits of a number
Add all the digits of a number in Python
Q. Write a Python program to add all the digits of a number.
Output
Source Code
// WAP to add all the digits of a number n= int(input("Enter a number: ")) s=0 while(n!=0): r=n%10 s=s+r n=n//10 print("Sum= ",s)
Copy Code
Python Programs
Swapping using 3rd variable
Swpping without using 3rd variable
Even or Odd check
Add all digits of a number
Add all Even and Odd digits of a number
No comments:
Post a Comment
Newer Post
Older Post
Home
Contact Form
Name
Email
*
Message
*
No comments:
Post a Comment