Skip to content

Instantly share code, notes, and snippets.

@Zulqurnain
Created January 13, 2014 15:11
Show Gist options
  • Save Zulqurnain/caba178d8fd145f97225 to your computer and use it in GitHub Desktop.
Save Zulqurnain/caba178d8fd145f97225 to your computer and use it in GitHub Desktop.
C++ program to print: 13579 3579 579 79 9
#include<iostream>
using namespace std;
int main(){ // done by Zulqurnain jutt
int Number=13579;
for(int i=Number,j,count=1;i!=0;count=1){
for(j=i;j!=0;j/=10,count*=10){}
cout<<i<<"\n";
count/=10;
i%=count;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment