Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- int h1,h2,m1,m2,s1,s2,diff,seg1,seg2;
- printf("Entre com o primeiro horairo : (formato hh/mm/ss)\n"); scanf("%d %d %d",&h1,&m1,&s1);
- printf("Entre com o segundo horario : (formato hh/mm/ss)\n"); scanf("%d %d %d",&h2,&m2,&s2);
- seg1 = (h1*3600) + (m1*60) + s1;
- seg2 = (h2*3600) + (m2*60) + s2;
- diff = abs(seg1-seg2);
- printf("A diferenca eh de : %d segundos\n",diff);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment