Skip to content

Commit

Permalink
11 | 1-2 | sharafat
Browse files Browse the repository at this point in the history
  • Loading branch information
SharafatKarim committed Aug 11, 2023
1 parent 8a179aa commit 79d3a59
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
19 changes: 19 additions & 0 deletions solutions/sharafat/11/1.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include <stdio.h>

struct time_struct
{
int hour;
int minute;
int second;
};

int main()
{
struct time_struct time;
printf("Enter time in HH:MM:SS format: ");
scanf("%d:%d:%d", &time.hour, &time.minute, &time.second);
printf("Equivalent time: ");

printf("%d:%d:%d\n", time.hour, time.minute, time.second);
return 0;
}
28 changes: 28 additions & 0 deletions solutions/sharafat/11/2.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#include <stdio.h>

struct time_struct
{
int hour;
int minute;
int second;
};

void input_time(struct time_struct *time)
{
printf("Enter time in HH:MM:SS format: ");
scanf("%d:%d:%d", &time->hour, &time->minute, &time->second);
}

void print_time(struct time_struct time)
{
printf("Equivalent time: ");
printf("%d:%d:%d\n", time.hour, time.minute, time.second);
}

int main()
{
struct time_struct time;
input_time(&time);
print_time(time);
return 0;
}

0 comments on commit 79d3a59

Please sign in to comment.