اذهب إلى المحتوى
  • 0

حل مسائل بلغه c

مصعب عبد الكريم

السؤال

أرجو حل المسأله هذه المسأله 

Write c program that allow the user to enter enter integer number and display the value in hours and minutes  for example:197 minutes becomes 3 hours and 17 minutes 

و شكرآ

تم التعديل في بواسطة مصعب عبد الكريم
رابط هذا التعليق
شارك على الشبكات الإجتماعية

Recommended Posts

  • 0

It will be something like this

#include <stdio.h>

main()
{
int total_amount_seconds, hour, min;

printf("Give me the total amoumnt of seconds:\n");
scanf("%d", &total_amount_seconds);

hour = total_amount_seconds / 3600;
total_amount_seconds = total_amount_seconds % 3600;

min = total_amount_seconds / 60;
total_amount_seconds = total_amount_seconds % 60;

printf("There are:\nH:M:S - %d:%d:%d", hour, min, total_amount_seconds);
}

 

رابط هذا التعليق
شارك على الشبكات الإجتماعية

انضم إلى النقاش

يمكنك أن تنشر الآن وتسجل لاحقًا. إذا كان لديك حساب، فسجل الدخول الآن لتنشر باسم حسابك.

زائر
أجب على هذا السؤال...

×   لقد أضفت محتوى بخط أو تنسيق مختلف.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   جرى استعادة المحتوى السابق..   امسح المحرر

×   You cannot paste images directly. Upload or insert images from URL.

  • إعلانات

  • تابعنا على



×
×
  • أضف...