ممكن مساعدة في سؤال في cpcs202 جاب لي الصداع
السلام عليكم
هذا السؤال حاولت احله بكل الطرق مو راضي ينحل يا ليت تساعدوني السؤال هو
4. Write a program that takes three numbers from the user and then displays their average?
الحل طلع معي كذه
Scanner keyboard = new Scanner(System.in);
System.out.println("Enter the first number:");
int num1=keyboard.nextInt();
System.out.println("Enter the first number:");
int num2=keyboard.nextInt();
System.out.println("Enter the first number:");
int num3=keyboard.nextInt();
int avg=(num1+num2+num3)/3;
System.out.println(avg);
[COLOR="rgb(46, 139, 87)"]والاجابة[/COLOR]
run:
Enter the first number:
هل الحل صحيح ام لا
|