You are on page 1of 2

#include<iostream>

#include<cmath>
#include<cstring>
using namespace std;
int main()
{
cout<<"Unesite jedan broj"<<endl;
int a,b,c,d,j,m,g,p,n;
char l;
cout<<"Ukucajte zapocni";
gets(l);
if(l=='z')
{
while(a!=0)
cin>>a;
j=0;
c=0;
d=0;
g=1;
p=a;
for(;p!=0;p=p/10)
{
j++;
}
for(m=0;m<j-1;m++)
{

g=g*10;
}
do
{
b=(a/g)%10;
cout<<b<<endl;

if(b%2==0)
{
c++;
}
d++;
a=a*10;
} while(d!=j);
if(c==d)
cout<<"broj ima sve cifre parne"<<endl;
else
cout<<"Broj nema sve cifre parne";
}
return 0;
}

You might also like