1 087
订阅者
无数据24 小时
无数据7 天
无数据30 天
帖子存档
برنامج بقراءة عشرة وايجاد مجموع الاعداد الفرديه
👇👇👇
#include <iostream>
using namespace std;
int main(){
int x=1, number, sum=0;
while (x<=10){
cout<<"pleas enter number " <<x<<"\n";
cin>> number;
if(number % 2==1){
sum+=number;
x++;
}}
cout <<"The sum is : "<<sum;
return 0;
آ๘ﮩ₰ﮩ₰ﮩ.❥ُ ِ ...:
طباعة الاعداد الفردية
#include<iostream>
using namespace std ;
int main ()
{
int i=1;
while(i<=10)
{
cout<<i<<endl;
i=i*2+1;
}
}
👍👍
آ๘ﮩ₰ﮩ₰ﮩ.❥ُ ِ ...:
طباعة الاعداد الفردية
#include<iostream>
using namespace std ;
int main ()
{
int i=1;
while(i<=10)
{
cout<<i<<endl;
i=i*2+1;
}
}
👍👍
برنامج لحساب وطباعة الشكل التالي
(1/1)+(1/2)+(1/3)+(1/4)
👇👇👇
#include <iostream>
using namespace std;
int main(){
float sum=0 ,n,i;
cin>>n;
for( i=1; i<=n; i++){
cout<<"(1/"<<i<<")+"<<" ";
sum+=1/i;
}
cout<<endl;
cout<< sum;
return 0;
}
♥️ ♥️ ♥️ ♥️
المخرجات
4
(1/1)+ (1/2)+ (1/3)+ (1/4) 2.08333 [Program finished]
اكتب برنامج لايجاد اكبر قيمه بين عددين مدخلين
👇👇👇
#include <iostream>
using namespace std;
int main(){
int a,b,max;
cout<<"enter 2 number\n";
cin>>a>>b;
if(a>b)
max=a;
else
max=b;
cout<<max;
return 0;
🌸 🌸 🌸 🌸 🌸 🌸 🌸
برنامج لطباعة اكبر عدد بين عددين مدخلين
👇👇👇
#include <iostream>
using namespace std;
int main(){
int a,b,max;
cout<<"enter 2 number\n";
cin>>a>>b;
if(a>b)
cout<<a;
else
cout<<b;
return 0;
}
الطباعة تختلف تمامًا عن الايجاد بكتابه الكود 😉👍
برنامج لطباعه التسلسل التالي
1 2 3 5 8 13 21 34 55 89
👇👇👇
#include <iostream>
#include <cmath>
using namespace std;
int main(){
int a,b,c;
a=b=1;
for(int i=1; i<=10; i++){
cout<<" ";
c=a+b;
a=b;
b=c;
cout<<a;}
return 0;}
🌸🌸🌸🌸
المخرجات
1 2 3 5 8 13 21 34 55 89
[Program finished]
التحويل من النظام العشري إلى الثماني
👇👇👇
#include <iostream>
#include <cmath>
using namespace std;
int main(){
int n, e,x=0 ,s=0;
cin>>n;
while( n!=0)
{
e=n%8;
n/=8;
cout<<e; }
return 0;
}
برنامج لتحويل العدد من النظام العشري الي الثنائي
👇👇👇
#include <iostream>
#include <cmath>
using namespace std;
int main(){
int n, e,x=0 ,s=0;
cin>>n;
while( n!=0)
{
e=n%2;
n/=2;
cout<<e;
}
return 0;
}
💞💞💞💞💞
المخرجات
9
1001 [Program finished]
برنامج لتحويل العدد من النظام ثنائي الي النظام العشري
👇👇👇
#include <iostream>
#include <cmath>
using namespace std;
int main(){
int n, e,x=0 ,s=0;
cin>>n;
while( n!=0)
{
e=n%10;
n/=10;
s+=e*pow(2,x);
x++;
}
cout<<"the decimal number is="<<s;
return 0;
}
🌸 🌸 🌸 🌸
المخرجات
111
7 [Program finished]
برنامج لحساب مجموع درجات الطالب وايجاد المعدل
👇👇👇
#include <iostream>
using namespace std;
int main(){
float x1,x2,x3,x4,x5,x6,x7;
int sum=0;
string name;
cout<<"please enter the degree for subject:\n";
cin>>x1>>x2>>x3>>x4>>x5>>x6>>x7;
cout<<"please enter student name:\n";
cin>>name;
cout<<name;
sum=x1+x2+x3+x4+x5+x6+x7;
sum/7;
if(sum<49)
cout<<"pass";
else
cout<<"sucsses";
return 0;
}
🌹🌹🌹🌹🌹🌹
هذا 👇البرنامج في خطأ هو ان float مع باقي قسمه عدد مايخرج مخرجات
لانه مايقبل عدد كسري مع حقيقي ويوجد له باقي القسمه
👇👇👇
#include <iostream>
using namespace std;
int main(){
float x=3.5;
int z;
x=x/2;
z=x%5;
cout<<z;
return 0;
}
التصحيح
بنغير نوع المتغير x من float الي int
👍
برنامج لايجاد مضروب كل عدد زوجي ادخله المستخدم 👍
👇👇👇
#include <iostream>
using namespace std;
int main(){
int f=1,n;
cout<<"please enter number\n";
cin>>n;
if(n%2==0){
for(int i=1; i<=n; i++)
f*=i;
cout<<"the factorial is="<<f;}
else
cout<<"enter the number isn t even\n";
return 0;
}
♥️ ♥️ ♥️ ♥️ ♥️
المخرجات
اذا ادخل عدد فردي 👇
please enter number
5 enter the number isn t even [Program finished]
🌸🌸🌸🌸🌸
اذا ادخل عدد زوجي 👇👇
please enter number
6 the factorial is=720 [Program finished]
برنامج لايجاد الاعداد المحصوره بين[١~٣٠]
👇👇👇
#include <iostream>
using namespace std;
int main(){
int n,z=1;
cout<<"enter the number\n";
cin>>n;
if(n>10 && n<30)
while (n<30){
n+=z;
cout<<n<<endl;}
else
cout<<"error";
return 0;
}
🌸🌸🌸🌸
المخرجات
enter the number
20 21 22 23 24 25 26 27 28 29 30
[Program finished]
برنامج لطباع الشكل
*
*
*
(program finish)
👇👇
#include <iostream>
using namespace std;
int main(){
int n=3;
for(int i=0; i<n; i++){
cout<<endl;
for(int j=0; j<n; j++)
if(i+j==n-1)
cout<<"*";
else
cout<<" ";
}
return 0;
}
برنامج لايجاد مضروب اي عدد يدخله المستخدم 👏👏👏
#include <iostream>
using namespace std;
int main(){
int f=1,i=1,n;
cout<<"enter the number\n";
cin>>n;
while(i<=n){
f*=i;
i++;
cout<<"the factorial is="<<f;
}
return 0;
}
🌱🌱🌱🌱🌱🌱
المخرجات
5
factorial is=120
حدد مخرجات البرنامج👇👇👇
#include <iostream>
using namespace std;
int main(){
for(int i=0; i<5; i++)
{
for(int j=0; j<5; j++){
if(i==2 || j==2)
cout<<i<<"*";
else
cout<<" ";
}
cout<<"\n";
}
return 0;
}
🌸🌸🌸🌸
المخرجات
0*
1*
2*2*2*2*2*
3*
4*
برنامج لمحاكه المحطه 👇👇
#include <iostream>
using namespace std;
int main(){
char t;
int digit,amount, price;
cin>>t;
if(t== d )
cout<<"please enter the price litr for diesle\n";
else if(t== b )
cout<<"please enter the price litr for benzin\n";
else if(t== g )
cout<<"please enter the price litr for gas\n";
cin>>price;
cout<<"please enter amount\n";
cin>>amount;
for(int i=price; i<=amount; i++)
digit=amount /price;
cout<<"digit litrs="<<digit<<endl;
cout<<"price litrs="<<price<<endl;
cout<<"amount litrs="<<amount;
return 0;
}
برنامج لايجاد حل المعادله
(a+a1)/(a*b)-a وايجاد الحل اذا كان موجب او سالب
👇👇👇👇
#include <iostream>
using namespace std;
int main(){
int a,a1,b;
float s;
cout<<"please enter the number\n";
cin>>a>>a1>>b;
s=(a+a1)/(a*b)-a;
cout<<"s="<<s<<endl;
if(s>=0)
cout<<"positive\n";
else
cout<<"negative\n";
return 0;
}
حدد الشكل المخرج 👇👇
#include <iostream>
#include <conio.h>
using namespace std;
int main(){
for(int i=0; i<=5; i++){
for(int j=0; j<=5; j++){
if(j<i){
cout<<" "<<"*";
break;
}
else
cout<<"*";}}
getch();
return 0;
}
🌹🌹🌹🌹🌹
المخرجات
** * * * * *
[Program finished]
