Advertisement
hiker43

Proizvod na cifri

Aug 10th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.40 KB | None | 0 0
  1. #include <iostream>
  2.  typedef unsigned long long ullong;
  3.  
  4. int main()
  5. {
  6.     using std::cout;
  7.     using std::cin;
  8.     using std::endl;
  9.  
  10.     ullong n, proizvodCifri;
  11.     cout << "Vnesi eden broj:\t";
  12.     cin>>n;
  13.      proizvodCifri=1;
  14.      while (n>0)
  15.      {
  16.  
  17.          proizvodCifri*=n%10;
  18.          n=n/10;
  19.  
  20.  
  21.      }
  22.     cout<<"Proizvodot na cifrite e:\t"<<proizvodCifri;
  23.  
  24.  
  25.  
  26.     return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement