C Books Guide and List
C++ Books Guide and List
Best Java Books

3,749 questions

4,049 answers

114 comments

10,705 users

Write a C program to create the user defined data type hours on int data type and use it in the program ?

0 votes
68 views
asked by smith Geek (15,340 points)

1 Answer

0 votes

#include<stdio.h>

#include<conio.h>

#define H 60

void main()

{

typedef int hours;

hours hrs;

clrscr();

printf(“Enter hours:”);

scanf(“%d”, &hrs);

printf(“\nMinutes: %d”,hrs*H);

printf(“\n Seconds: %d”,hrs*H*H);

getch();

}

Output:

Enter hours: 2

Minutes: 120

Seconds: 7200 

answered by rajesh Guru (39,140 points)

...