Toggle navigation
Courses
Danh sách câu hỏi
Từ khóa
Thành viên
04-06 Lab exercise 1: Structure to handle Time
0
thích
0
k thích
3.5k
đã xem
Write a program with following requirements:
Define the
structure
type time with fields: hours, minutes, and seconds.
Write a function that takes an integer as parameter and converts that integer (as seconds) to hours, minutes, and seconds. These values should be stored into the fields of a structure of type time, and
the function should return that structure
.
Write a program that reads an integer, calls the function, and displays the fields of the returned structure.
Example input:
7776
Example output:
2:9:36
[Exercise]
Coding (C)
-
đã hỏi
ngày 6 tháng 4 năm 2017
trong
C
ID: 23557 -
Xem được từ:
Không giới hạn
-
Hiệu lực đến:
Không giới hạn
|
3.5k
đã xem
bình luận
0
0
Called for Help
Hãy
đăng nhập
hoặc
đăng ký
để thêm bình luận.
32
Trả lời
0
thích
0
k thích
Hidden content!#include * ***** ** *
* * ** * ** * * ** *
struct Clock{
** * * * * * * * * ** *** hours;
* * *** * * * * ** * * minutes;
* * * *** * * ** *** seconds;
};
int main(){
* ** * ** ** ** * * * input;
* * * * **** ****** * * ***** Clock * *
* * * * * ** * ** * *** * * * * * ** * * * ** * * ******