أضف مشاركة إلى الموضوع: مساعده في مادة ++c
اضغط هنا للدخول
يمكنك إختيار أيقونة لرسالتك من هذه القائمة
سيتم تحويلها www.example.com إلى [URL]http://www.example.com[/URL].
رد: مساعده في مادة ++c يسلمو زيد غلبتك معي الله يسعدك ما احسنك يسلمو صديقة غلبتك احرجتوني
رد: مساعده في مادة ++c
رد: مساعده في مادة ++c المشاركة الأصلية كتبت بواسطة mylife079 write a void function named swap that recives 2 integer and swap them. كود PHP: #include <iostream.h> void swap(int x, int y); void main() { int n1,n2; cin>>n1; cin>>n2; cout<<x<<endl<<y<<endl; swap(n1,n2); } void swap(int x, int y) { int temp; temp = x; x = y; y = temp; cout<<x<<endl<<y<<endl; }
#include <iostream.h> void swap(int x, int y); void main() { int n1,n2; cin>>n1; cin>>n2; cout<<x<<endl<<y<<endl; swap(n1,n2); } void swap(int x, int y) { int temp; temp = x; x = y; y = temp; cout<<x<<endl<<y<<endl; }
رد: مساعده في مادة ++c write c++ program contains afunction called sum that receives an integer number of any length and return the sum of digits that is multiple of 3 only then call your function from main function
رد: مساعده في مادة ++c المشاركة الأصلية كتبت بواسطة mylife079 write a function that recives 2 integer numbers and print the prime numbers between them. كود PHP: #include <iostream.h> void primes(int initial, int final); void main() { int initial, final; cout << "Enter initial value: "; cin >> initial; cout << "Enter final value: "; cin >> final; cout << endl <<"Prime nummbers between " << initial << " and " << final << " are: " << endl << endl; primes(initial,final); } int rem; void primes(int initial, int final) { for ( int a=initial; a<=final ; a++ ) { bool numisprime = 1; for (int i=2 ; i < a ; i++ ) { rem = a%i; if (rem==0) { numisprime = 0; } } if (numisprime!=0) cout << a << endl; } }
#include <iostream.h> void primes(int initial, int final); void main() { int initial, final; cout << "Enter initial value: "; cin >> initial; cout << "Enter final value: "; cin >> final; cout << endl <<"Prime nummbers between " << initial << " and " << final << " are: " << endl << endl; primes(initial,final); } int rem; void primes(int initial, int final) { for ( int a=initial; a<=final ; a++ ) { bool numisprime = 1; for (int i=2 ; i < a ; i++ ) { rem = a%i; if (rem==0) { numisprime = 0; } } if (numisprime!=0) cout << a << endl; } }
رد: مساعده في مادة ++c المشاركة الأصلية كتبت بواسطة mylife079 write a function that recives an integer number and return true if it is a prime number and false otherwise. اكتب اقتران يستقبل رقم من نوع int وبرجع true اذا الرقم اولي false اذا غير ذلك كود PHP: #include <iostream>bool isPrime(int x){ int max = static_cast <int> (x); if (x <= 0 || x == 1 || (x % 2 == 0 && x != 2)) return false; for (int i = 3; i < max; i += 2) if (x % i == 0) return false; return true;}int main (){ for (int i = 2; i < 100; i++) if (isPrime(i)) std::cout << i << " is a prime number!" << std::endl; std::cin.get(); return EXIT_SUCCESS;}
#include <iostream>bool isPrime(int x){ int max = static_cast <int> (x); if (x <= 0 || x == 1 || (x % 2 == 0 && x != 2)) return false; for (int i = 3; i < max; i += 2) if (x % i == 0) return false; return true;}int main (){ for (int i = 2; i < 100; i++) if (isPrime(i)) std::cout << i << " is a prime number!" << std::endl; std::cin.get(); return EXIT_SUCCESS;}
رد: مساعده في مادة ++c اه اوكي عرفتها عندي كتاب كامل بالعربي سي بلس بلس
رد: مساعده في مادة ++c write a void function named swap that recives 2 integer and swap them.
رد: مساعده في مادة ++c write a function that recives 2 integer numbers and print the prime numbers between them.
مساعده في مادة ++c write a function that recives an integer number and return true if it is a prime number and false otherwise. اكتب اقتران يستقبل رقم من نوع int وبرجع true اذا الرقم اولي false اذا غير ذلك
مساعده في مادة ++c
قوانين المنتدى