Sunday, 21 October 2012

Finding the sum of the cubes of individual digits of a number

By The Programming Trailblazers   Posted at   Sunday, October 21, 2012   No comments

Program to find the cube of the individual digits of a number.
__________________________________

#include<iostream.h>
#include<conio.h>
void main()
{ 
   clrscr();
   int a,cube,sum=0,rem;
   cout<<"\nEnter the number: ";
   cin>>a;
   while(a>0)
     { rem=a%10;
       cube=a*a*a;
       sum+= cube;
       a/=10;
     }
   cout<<"\nThe cube sum of individual digits is: "<<sum;
   getch();
}




About the Author

Nulla sagittis convallis arcu. Sed sed nunc. Curabitur consequat. Quisque metus enim, venenatis fermentum, mollis in, porta et, nibh. Duis vulputate elit in elit. Mauris dictum libero id justo.
View all posts by: BT9

0 comments :

Back to top ↑
Connect with Us

    Total Pageviews

    Powered by Blogger.

    Followers

    Blogroll

What they says

© 2013 The Programming Trailblazers . WP Mythemeshop Converted by Bloggertheme9
Blogger templates . Proudly Powered by Blogger .