Quick actions

cmd+k|ctrl+k

Navigation

Languages

lab4_159

Snippet info

Language

Cpp

Visibility

public

Author

matho.camara

Created

2018-10-30T16:22:17Z

Updated

2018-11-08T06:54:12Z

#include <iostream>
using namespace std;

int main() {
    int a,b,count;
   cout<<"Input a and b values. (a/b) :"<<endl;
   cin>>a>>b;
  
   //computing
    count=a;
   if(count>b)
   count=b;
   if(a!=0 && b!=0)
   {
        cout<<"Result:"<<endl;
       for(int i=1;i<=count;i++)
       {
          if(a%i==0 && b%i!=0 )
          cout<<i<<endl;
          else if(a%i!=0 && b%i==0 )
           cout<<i<<endl;
       } 
   }
       return 0;
}
INFO