When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.
9 messages · Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.
#include <iostream>
using namespace std;
string factorial(int num) {
string result;
for (int i = 12; i >= 2; i--) {
if (num % i == 0) {
result += to_string(num / i);
return result;
}
}
return "";
}
int main() {
string fact = factorial(12);
cout << fact << endl;
return 0;
}
what is string
#1013107104678162544
huh wdym
wrong channel, this is for c and <iostream> is definitely a C++ header
as monke said, #1013107104678162544
@gilded rock
Please don't delete forum posts. They can be helpful to refer to later and other members can learn from them. In the future you can use !solved to close a post and mark a post as solved.
!solved