1 solutions

  • 0
    @ 2023-12-3 17:03:15

    C :

    #include<stdio.h>   
    
    int main(){ 
    int i;
    
    for(i = 10;i <= 1000;i++){
    if( i % 2 == 0 && i % 3 == 0 && i % 7 == 0){
    printf("%d\n",i);
    
    }
    }
    
    return 0;
    } 
    

    C++ :

    #include<iostream>
    #include<cmath>
    using namespace std;
    
    int main( ){
    	int i;
    	for(i = 10;i <= 1000;i++){
    		if(i % 2 == 0 && i % 3 == 0 && i % 7 == 0){
    			cout<<i<<endl;
    		}
    	}
    }
    

    Python :

    for i in range(10, 1001):
        if i % 2 == 0 and i % 3 == 0 and i % 7 == 0:
            print(i)
    
    • 1

    Information

    ID
    822
    Time
    1000ms
    Memory
    16MiB
    Difficulty
    (None)
    Tags
    # Submissions
    0
    Accepted
    0
    Uploaded By