تعلم البرمجة بلغة<++C> من البداية
Kanalga Telegram’da o‘tish
1 087
Obunachilar
Ma'lumot yo'q24 soatlar
Ma'lumot yo'q7 kun
Ma'lumot yo'q30 kun
Postlar arxiv
حدد مخرجات البرنامج
👇👇
#include <iostream>
using namespace std;
int main(){
int a=5, b=a-2, r=b;
++a;
b++;
r=++a + ++b +a++ + ++b/2;
cout<<r;
return 0;
}
🌱🌱🌱🌱
المخرجات
22
🌱🌱🌱🌱🌱🌱🌱🌱
التحليل
r=7+5+7+6/2;
7+5+7+3
12+7+3
19+3
22
😄
//حدد المخرجات
👇👇
#include <iostream>
#include <conio.h>
using namespace std;
int main(){
int f=1.5, p=f*2;
f+=p++;
int y=8;
if(f==4 || f==3)
cout<<(f*p)+5*0+f+y;
int e=3;
for(int i=e; i<=3; i+=2)
if(i != p)
break;
else {
++p;
p++;
cout<<++p*3;}
getch();
return 0;
}
🎗🎗🎗
المخرجات
2018
//حدد المخرجات
👇👇
#include <iostream>
using namespace std;
int main(){
int x=10 ,y;
bool b;
b = x - 50 ;
y = b + 50 ;
cout << x << b <<y ;
}
🌱🌱🌱🌱
المخرجات
10151
[Program finished]
حدد المخرجات
👇👇👇
#include <iostream>
#include <conio.h>
using namespace std;
int main () {
int a=0, b=a, c=20;
for(int p=c; p<=30; p++){
if(p%2==0)
a+=1;
else
b++;}
cout<<"the result1="<<a<<endl;
cout<<"the result2="<<b;
for(int i=a; i<=10; i++)
cout<< "*" << "\t" <<"ok";
getch();
return 0; }
🎗🎗🎗🎗🎗
المخرجات
the result1=6
the result2=5* ok* ok* ok* ok* ok
[Program finished]
حدد مخرجات البرنامج
👇👇👇
#include <iostream>
#include <conio.h>
using namespace std;
int main(){
char w= a , d= c ;
while (w<= c ){
cout<<(w);
if(w== b ){
cout<<"T";
break;}
w++;}
getch();
return 0;
}
🌸 🌸 🌸 🌸 🌸
المخرجات
abT
#include <iostream>
#include <conio.h>
using namespace std;
int main(){
int x,w;
cout<<"enter the x:";
cin>>x;
if(x<0)
{w=x*x;
x=3*x;}
else
if(x!=0)
{w=3*w;
x=2*w;}
else{
w=5*1;
x=4*w;}
w+=x;
x+=w;
cout<<w+x;
getch();
return 0;
}
🌿🌿🌿🌿🌿
المخرجات
enter the x:1
24 [Program finished]
☘☘☘☘
enter the x:-1
-7 [Program finished]
حدد المخرجات في حاله قيمه x=2
👇
#include <iostream>
#include <conio.h>
using namespace std;
int main(){
char x;
cin>>x;
switch (x){
case 1 : {
int a=5;
cout<<"2*"<<a*2; }
case 2 :{
int b=3;
b=0;
cout<<"2="<<b*5;
break ;}
default :
cout<<"value of x unknown ";
}
getch();
return 0;
}
💞💞💞💞💞
المخرجات
2
2=0 [Program finished]
حدد المخرجات 👇👇👇
#include <iostream>
#include <conio.h>
using namespace std;
int main(){
int f=3,p=2;
f+=f*p;
p=3;
p++;
f=f-p;
p=f+p;
cout<<(f*p)+5<<endl;
int e=3;
for(int i=e; i<=3; i+=2){
if(i==e)
break;
else
cout<<(i*3)+60; }
getch();
return 0;
}
☘☘☘☘
المخرجات
50
//برنامج لطباعه الشكل
*
*
*
*
*
👇👇👇👇
#include<iostream>
using namespace std;
int main()
{int z,x;
for(z=1;z<=5;z++){
cout<<"*\n" ;
for(x=0;x<=z-1;x++)
cout<<" " ;
}
return 0;
}
برنامج لادخال الاسم وكلمة المرور
👇👇👇
#include <iostream>
using namespace std;
int main()
{
string user_name,password;
cout<<"please enter user name"<<endl;
cin>>user_name;
cout<<"please enter password"<<endl;
cin>>password;
if(user_name=="hamza" && password=="12345" )
cout<<"open" <<endl;
else if(user_name!="hamza"&&password=="12345")
{
cout<<"user name error \n enter user name"<<endl;
cin>>user_name;
if(user_name!="hamza"){
cout<<"user name error \n enter user name"<<endl;
cin>>user_name;
if( user_name!="hamza" )
cout<<"user_name error \n close"<<endl;
else
cout<<"open"<<endl;
} else cout<<"open"<<endl;
}
else if( user_name=="hamza"&&password!="12345" )
{
cout<<"password error \n enter password"<<endl;
cin>>password;
if(password!="12345" ) {
cout<<"password error \n enter password"<<endl;
cin>>password;
if(password!="12345" )
cout<<"password error \n close"<<endl;
else
cout<<"open"<<endl;
} else cout<<"open"<<endl;
}
else if( user_name!="hamza"&&password!="12345" )
{
cout<<"user name and password error \n enter user name and password"<<endl;
cin>>user_name>>password;
if( user_name!="hamza"&&password!="12345" ){
cout<<"user name and password error \n enter user name and password"<<endl;
cin>>user_name>>password;
if( user_name!="hamza"&&password!="12345" )
cout<<"user name and password error \n close"<<endl;
else
cout<<"open"<<endl;
} else cout<<"open"<<endl;
}
return 0;
//برنامج لطباعه جدول الضرب من 1الي12. 👇
#include <iostream>
using namespace std;
int main(){
int i, j;
for(i=1; i <=12 ;i++){
cout <<"Multiple tabel for ("<<i <<").\n..............\n";
for(j=1; j <=12; j++)
cout <<j<<" * " << i <<"="<<i*j <<"\n"; }
cout <<"\n";
return 0;
}
☘☘☘☘☘
المخرجات
Multiple tabel for (1).
.............. 1 * 1=1 2 * 1=2 3 * 1=3 4 * 1=4 5 * 1=5 6 * 1=6 7 * 1=7 8 * 1=8 9 * 1=9 10 * 1=10
11 * 1=11
12 * 1=12
Multiple tabel for (2).
..............
1 * 2=2
2 * 2=4
3 * 2=6
4 * 2=8
5 * 2=10
6 * 2=12
7 * 2=14
8 * 2=16
9 * 2=18
10 * 2=20
11 * 2=22
12 * 2=24
Multiple tabel for (3).
..............
1 * 3=3
2 * 3=6
3 * 3=9
4 * 3=12
5 * 3=15
6 * 3=18
7 * 3=21
8 * 3=24
9 * 3=27
10 * 3=30
11 * 3=33
12 * 3=36
Multiple tabel for (4).
..............
1 * 4=4
2 * 4=8
3 * 4=12
4 * 4=16
5 * 4=20
6 * 4=24
7 * 4=28
8 * 4=32
9 * 4=36
10 * 4=40
11 * 4=44
12 * 4=48
Multiple tabel for (5).
..............
1 * 5=5
2 * 5=10
3 * 5=15
4 * 5=20
5 * 5=25
6 * 5=30
7 * 5=35
8 * 5=40
9 * 5=45
10 * 5=50
11 * 5=55
12 * 5=60
Multiple tabel for (6).
..............
1 * 6=6
2 * 6=12
3 * 6=18
4 * 6=24
5 * 6=30
6 * 6=36
7 * 6=42
8 * 6=48
9 * 6=54
10 * 6=60
11 * 6=66
12 * 6=72
Multiple tabel for (7).
..............
1 * 7=7
2 * 7=14
3 * 7=21
4 * 7=28
5 * 7=35
6 * 7=42
7 * 7=49
8 * 7=56
9 * 7=63
10 * 7=70
11 * 7=77
12 * 7=84
Multiple tabel for (8).
..............
1 * 8=8
2 * 8=16
3 * 8=24
4 * 8=32
5 * 8=40
6 * 8=48
7 * 8=56
8 * 8=64
9 * 8=72
10 * 8=80
11 * 8=88
12 * 8=96
Multiple tabel for (9).
..............
1 * 9=9
2 * 9=18
3 * 9=27
4 * 9=36
5 * 9=45
6 * 9=54
7 * 9=63
8 * 9=72
9 * 9=81
10 * 9=90
11 * 9=99
12 * 9=108
Multiple tabel for (10).
..............
1 * 10=10
2 * 10=20
3 * 10=30
4 * 10=40
5 * 10=50
6 * 10=60
7 * 10=70
8 * 10=80
9 * 10=90
10 * 10=100
11 * 10=110
12 * 10=120
Multiple tabel for (11).
..............
1 * 11=11
2 * 11=22
3 * 11=33
4 * 11=44
5 * 11=55
6 * 11=66
7 * 11=77
8 * 11=88
9 * 11=99
10 * 11=110
11 * 11=121
12 * 11=132
Multiple tabel for (12).
..............
1 * 12=12
2 * 12=24
3 * 12=36
4 * 12=48
5 * 12=60
6 * 12=72
7 * 12=84
8 * 12=96
9 * 12=108
10 * 12=120
11 * 12=132
12 * 12=144
[Program finished]
🤩
برنامج لحساب مضاعفات العدد 2 حتي 32.
#include <iostream>
#include <conio.h>
using namespace std;
int main(){
clrscr();
int i;
for(i=1; i<=32; i*=2)
cout<<i<<" ";
getch();
return 0;
}
الداله ;()clrscr هي داله عدد حوفها سته حروف تعمل على تنظيف الشاشه
الداله ;()getch هي داله تعمل على تثبيت الداله main وتنفيذها 👍
ارسم الشكل المخرج👇
الشكل المخرج بهذا البرنامج بيكون باستخدام شرط if
#include <iostream>
#include <conio.h>
using namespace std;
int main(){
for(int i=5; i>0; i--){
cout<<endl;
for(int j=5; j>=0; j--)
if(j<i)
cout<<"*";
else
cout<<" ";
}
getch();
return 0;
}
☘☘☘☘☘
الشكل المخرج
مثلث من جهه اليمين
* **** * *
🌸 🌸 🌸 🌸 🌸 🌸 🌸 🌸 🌸 🌸
الشكل المخرج بهذا البرنامج بيكون مثل الاول ولكن بدون استخدام الشرط وانما استخدم ثلاث دوارات 👇
#include <iostream>
#include <conio.h>
using namespace std;
int main(){
for(int i=1; i<=5; i++){
cout<<endl;
for(int j=1; j<=5; j++)
cout<<"";
for(int a=5; a>=i; a--)
cout<<"*";
}
getch();
return 0;
}
ارسم الشكل المخرج👇
#include <iostream>
#include <conio.h>
using namespace std;
int main(){
for(int i=5; i>0; i--){
cout<<endl;
for(int j=5; j>=0; j--)
if(j<i)
cout<<"*";
else
cout<<" ";
}
getch();
return 0;
}
☘☘☘☘☘
الشكل المخرج
مثلث من جهه اليمين
* **** * *
ما الشكل المخرج من البرنامج 👇
#include <iostream>
#include <conio.h>
using namespace std;
int main(){
for(int i=0; i<5; i++){
cout<<endl;
for(int j=5; j>=0; j--)
if(i<j)
cout<<" ";
else
cout<<"*";
}
getch();
return 0;
}
☘ ☘ ☘ ☘ ☘
المخرج
* * **** *
الشكل👆بس بيكون ب الجهه الاخري
اعله بالcompiler وبتشوف الشكل 👍
ارسم الشكل المخرج👇
#include <iostream>
#include <conio.h>
using namespace std;
int main(){
for(int i=1; i<=5; i++){
cout<<endl;
for(int j=5; j>=i; j--)
cout<<"*";
}
getch();
return 0;
}
🌸 🌸 🌸 🌸 🌸
الشكل المخرج
*
****
*
*
حدد الشكل المخرج 👇
#include <iostream>
#include <conio.h>
using namespace std;
int main(){
for(int i=4; i>=0; i--){
cout<<endl;
for(int j=i; j>=0; j--)
cout<<j; }
getch();
return 0;
}
☘☘☘☘☘
المخرجات
43210
3210
210
10
0
حدد الشكل المخرج من البرنامج 👇
#include <iostream>
#include <conio.h>
using namespace std;
int main(){
for(int i=1; i<10; i++){
cout<<endl;
for(int j=10; j>0; j--)
if(i<j){
cout<<" ";}
else
{cout<< j;}
for(int m=2; m<10; m++)
if(i<m)
cout<<" ";
else
cout<< m;
}
getch();
return 0;
}
💞💞💞💞💞
المخرجات
1 212 32123 4321234 543212345 65432123456 7654321234567 876543212345678 98765432123456789 [Program finished]
الشكل 👆المخرج من compiler بيكون شك هرم هون ملخبط شوي
حدد مخرجات البرنامج
#include <iostream>
#include <conio.h>
#include <cmath>
using namespace std;
int main(){
double num=0, val=0;
cout<<"enter the number:";
cin>>num;
val=sqrt(num);
cout<<"number (sqrt) "<<val<<endl;
cout<<"enter the power";
cin>>val;
val=pow(num , val);
cout<<"number (pow)"<< val<<endl;
getch();
return 0;
}
🌸🌸🌸🌸🌸
المخرجات
enter the number:4
number (sqrt) 2 enter the power2 number (pow)16 [Program finished]
< C++ > برمجة:
نشوف هذا البرنامج يطبع الاعداد الفرديه لانه يتجاوز الاعداد الزوجيه👇
#include <iostream>
#include <conio.h>
using namespace std;
int main(){
int n;
cout<<"please enter the number \t";
cin>>n;
cout<<endl;
for(int i=0; i<=n; i++){
if(i%2==0)
continue;
cout<<"the number is: "<<i;
cout<<endl;
}
getch();
return 0;
}
🌴🌴🌴🌴🌴
المخرجات
please enter the number 5
the number is: 1 the number is: 3 the number is: 5 [Program finished]
🌸🌸🌸🌸🌸🌸🌸🌸🌸🌸
بالنسبة لهذا البرنامج يعكس البرنامج الاول حيث يطبع الإعداد الزوجيه لانه يوجد في قوس الشرط علامه النفي( ! )
#include <iostream>
#include <conio.h>
using namespace std;
int main(){
int n;
cout<<"please enter the number \t";
cin>>n;
cout<<endl;
for(int i=0; i<=n; i++){
if(! (i%2==0) )
continue;
cout<<"the number is: "<<i;
cout<<endl;
}
getch();
return 0;
}
🌴🌴🌴🌴
المخرجات
please enter the number 5
the number is: 0 the number is: 2 the number is: 4 [Program finished]
