#Im trying to make a factorizer ( 3rd day learning c++)

9 messages · Page 1 of 1 (latest)

wide ginkgoBOT
#

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.

gilded rock
#
#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;

}

brave veldt
#

what is string

lime aurora
#

#1013107104678162544

gilded rock
acoustic scaffold
#

wrong channel, this is for c and <iostream> is definitely a C++ header

#

as monke said, #1013107104678162544

wide ginkgoBOT
#

@gilded rock

Please Do Not Delete Posts!

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.

gilded rock
#

!solved