السلام عليكم و رحمة الله و بركاته
شكرا لجهودكم و أتمنى مساعدتي في هذا البرنامج "
Write a program to print odd numbers, each in the new line and find the sum of these numbers and print the sum in the last line.
كتبت البرنامج بهذه الصيغة :
#include <iostream>
#include<conio.h>
using std::cout;
using std::endl;
int main()
{
for(int counter=1;counter<=100;counter++);
int total=1;
for(int number=3;number<=19;number+=2)
total+=number;
cout<<"the sum is"<<total<<endl;
return 0;
}كيف أتمكن من طباعة الأرقام ؟
الكود يظهر المجموع فقط

