Search
 
SCRIPT & CODE EXAMPLE
 

CPP

factore of 20 in c+

#include <iostream>
using namespace std;

int main() {
    int n, i;

    cout << "Enter a positive integer: ";
    cin >> n;

    cout << "Factors of " << n << " are: ";  
    for(i = 1; i <= n; ++i) {
        if(n % i == 0)
            cout << i << " ";
    }

    return 0;
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: delete 2d dynamic array c++ 
Cpp :: c++ overwrite file 
Cpp :: set precision in c++ 
Cpp :: how to change certain number from set c++ 
Cpp :: string to char array c++ 
Cpp :: extern __shared__ memory 
Cpp :: c++ display numbers as binary 
Cpp :: c++ read file to char buffer 
Cpp :: dlopen failed: library "libomp.so" not found 
Cpp :: xmake set exe name 
Cpp :: crypto npm random bytes 
Cpp :: char vector to string c++ 
Cpp :: arduino led code 
Cpp :: std string to const char * c++ 
Cpp :: range of long long in c++ 
Cpp :: cpp take lambda as parameter 
Cpp :: removing a character from a string in c++ 
Cpp :: initializing 2d vector 
Cpp :: c++ string remove last character 
Cpp :: C++ Multi-line comments 
Cpp :: how to do (binary) operator overloading in c++ 
Cpp :: change abstract title name latex 
Cpp :: c++ hours minutes seconds 
Cpp :: c++ call by value vs call by reference 
Cpp :: data types ranges c++ 
Cpp :: print all elements of vector c++ 
Cpp :: vector.find() 
Cpp :: not in c++ 
Cpp :: why we use iostream in C++ programming 
Cpp :: c++ template function 
ADD CONTENT
Topic
Content
Source link
Name
7+1 =