بدايه مبرمج
2.15K subscribers
77 photos
153 files
262 links
طريقك الى عالم البرمجه😍
حيث 1+1 لايساوي 2

💫أول قناه تستهدف الطلاب المبدئين وتبدا بالشروحات من الصفر...
Download Telegram
بدايه مبرمج
1) أكتب برنامج يقوم بكتابة الكلمات التالية :- welcome to C ++ ? 2) اكتب البرناج الاتي مرتين يطبع العمليات الحسابية بين العددين 10 و 12 ؟؟ وفي المرة الاخرى استخدم swich ? 3) أكتب برنامج يقوم بالتبديل بين قيمة متغيرين ؟ 4) أكتب برنامج يدخل النتيجة فيطبع…
🚫 حلول التمارين 🚫

1) #include<iostream.h>
using namespace std;

int main()
{
cout<"welcome to C++";
return0;
}
----------------------------------------------
2) #include<iostream.h>
using namespace std;
int main()
{
Cout <<"10+20="<<10+20;
Cout<<"10-20="<<10-20;
Cout<<"10*20=<<10*20;
عند القسمة :
Cout<<"20%10"<<20%10;

في حالة الswich
#include<iostream.h>
using namespace std;
int main()
{
int x ,y;
Char op;
Cin>>x=10;
Cin>>y=20;
Cout<<"Enter the number and math operator"<<endl;

Swich(op)
{
Case "+":
Cout <<x+y;
break;

Case"-":
Cout<<x-y;
break;
Case"*":
Cout<x*y;
break;

Case"/":
Cout<x%y;
break;
}
return0;
}
----------------------------------------------
3) #include<iostream.h>
using namespace std;
int main()
{
int x=8,y=6,d;
d=x;
X=y;
y=d; Cout<<"x="<<x<<endl<<"y="<<y;
return0;
}
----------------------------------------------
4) #include<iostream.h>
using namespace std;
int main()
{
int grade;
Cout<<"Enter the grade:";
Cin>>grade;
if (grade>50)
Cout<<": is passing"<<endl;
else
cout<<:is failing"<<endl;
return0;
}
________________________
#include<iostream.h>
using namespace std;
int main()
{
int grade;
cout<<enter the grade:";
if (grade>=90)
Cout<<":Excellent"<<endl;
else
if (grade>=80)
Cout<<":very Good"<<endl;
else
if (grade>=65)
Cout<<": Good"<<endl;
else
if (grade>=50)
Cout <<":Accepted"<<endl;
else
if (grade<50)
Cout<<": is failing"<<endl;
return0;
}
----------------------------------------------
(5) #include<iostream.h>
using namespace std;
int main()
{ int i;
for (i=1;i<=10;i++)
Cout<<i<<" ";
return0;
}
-------------
#include<iostream.h>
using namespace std;
int main()
{
int i=1;
while (i<<=10)
cout <<i<<" ";
i++;
return0;
}
------------------

#include<iostream.h>
using namespace std;
int main()
{
int i=1;
do
{ cout<<i<<" ";
i++;
}
While (i<=10);
rerurn0;
}


@programmer_101
#include <iostream>
using namespace std;
int GCD(int x,int y)
{
if(y==0) return x;
else
return GCD(y,x%y);
}
int LCM(int x,int y)
{
return x*y/GCD(x,y);
}
int main()
{
cout<<GCD(4,18)<<endl;
cout<<LCM(4,18)<<endl;
return 0;
}
#include بايثون👆