Viết chương trình các số lẻ từ 1 đến 99

2 câu trả lời

Program dem_so;

Uses crt ;

Var i,d : byte;

Begin 

d:=0;

For i:=1 to 99 do 

If i mod 2=1 then 

d:=d+ 1;

Writeln ('so so le tu 1 den 99 la:',d);

Readln

End.

Viết chương trình in các số lẻ từ 1 -> 99

#include <bits/stdc++.h>
using namespace std;
int main() {
    int i=1;
    for(;i<=99;i++){
        if(i%2!=0){
            cout<<i<<" ";
        }
    }
    //samon247
    return 0;
}