Menampilkan Bilangan genap 1-100 dan total bilangan Unknown 07.54 Unknown #include <iostream> #include <conio.h> using namespace std; int main(){ int tot=0; for(int i=1;i<=100;){ if(i%2==0){ cout<<i<<" "; tot+=i; i++; } else i++; } cout<<endl; cout<<"total = "<<tot; getch(); return 0; }
1 Komentar
Kak boleh minta tolong gak kk ?
Balas