Big mod
Code:
#include<iostream>
using namespace std;
int main()
{
int mod_num;
string str;
while(1){
cout<<"Enter the Big number: ";
cin>>str;
cout<<"Enter the mod number: ";
cin>>mod_num;
int temp=0;
for(int i=0;str[i]!='\0';i++){
temp*=10;
temp+=(str[i]-'0');
temp%=mod_num;
}cout<<"The mod value of "<<str<<" % "<<mod_num<<" = "<<temp<<endl;
}
return 0;
}
#include<iostream>
using namespace std;
int main()
{
int mod_num;
string str;
while(1){
cout<<"Enter the Big number: ";
cin>>str;
cout<<"Enter the mod number: ";
cin>>mod_num;
int temp=0;
for(int i=0;str[i]!='\0';i++){
temp*=10;
temp+=(str[i]-'0');
temp%=mod_num;
}cout<<"The mod value of "<<str<<" % "<<mod_num<<" = "<<temp<<endl;
}
return 0;
}
মন্তব্যসমূহ
একটি মন্তব্য পোস্ট করুন