Dfd Hjhh نشر 14 أبريل 2019 أرسل تقرير مشاركة نشر 14 أبريل 2019 write a program in C++ to generate 2 numbers in the range [ 10-20] then ask the user about the result of summation if the answer is true print excellent else print wrong answer. اقتباس رابط هذا التعليق شارك على الشبكات الإجتماعية More sharing options...
1 Entesar Khaled نشر 14 أبريل 2019 أرسل تقرير مشاركة نشر 14 أبريل 2019 You can answer something like this #include <iostream> #include <ctime> int randRange (int low, int high) { return rand() % (high - low) + low; } int main() { int num1, num2; int num1user, num2user; num1=randRange(10, 20); num2=randRange(10, 20); cout << "Please summation the first number "; cin >> num1user; cout << "Please summation the secound number "; cin >> num2user; if( num1==num1user && num2==num2user ) cout << "excellent "; else cout << "wrong answer"; cout << "\n first generated number is: " << num1; cout << "\n second generated number is: " << num2; return 0; } 1 اقتباس رابط هذا التعليق شارك على الشبكات الإجتماعية More sharing options...
السؤال
Dfd Hjhh
write a program in C++ to generate 2 numbers in the range [ 10-20] then ask the user about the result of summation if the answer is true print excellent else print wrong answer.
رابط هذا التعليق
شارك على الشبكات الإجتماعية
1 جواب على هذا السؤال
Recommended Posts
انضم إلى النقاش
يمكنك أن تنشر الآن وتسجل لاحقًا. إذا كان لديك حساب، فسجل الدخول الآن لتنشر باسم حسابك.