number - hundreds=num%1000/100 thousands=num%10000/1000

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 #include <iostream> using namespace std int main() { int ones,tens,hundreds,thousands,num cout << "Enter Number:" cin >> num ones=num%10 tens=num%100/10
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: hundreds=num%1000/100 thousands=num%10000/1000 cout&lt;&lt;&quot;Number:&quot; &lt;&lt; &quot; &quot;&lt;&lt; thousands&lt;&lt;&quot; &quot;&lt;&lt; hundreds&lt;&lt;&quot; &quot;&lt;&lt; tens&lt;&lt;&quot; &quot;&lt;&lt; ones&lt;&lt; endl return 0 }...
View Full Document

This note was uploaded on 07/27/2011 for the course COL 201 taught by Professor Magtibay during the Winter '10 term at De La Salle Lipa.

Ask a homework question - tutors are online