17:45 Number reverse by recurcive function | |
#include <iostream> using namespace std; int shrjum(int tiv) { int n=1, t = tiv; while ((t/10)!=0) { t/=10; n *=10; } if (tiv>=10) return (n*(tiv%10)) + shrjum(tiv/10); else return (tiv%10); } int main(){ int x; cin>>x; cout<<shrjum(x); return 0; } | |
|
Total comments: 0 | |