Analog Clock C program to find Mirror Image Clock Time

Saturday, 7 January 2017

If you want to find Mirror watch time then put input as your real watch time and in output you can find mirror image watch time.


#include<stdio.h>
#include<conio.h>
void main()
{
int h,m,s;
clrscr();
printf("Enter Hour: ");
scanf("%d",&h);
printf("Enter Min:");
scanf("%d",&m);
printf("Enter Second:");
scanf("%d",&s);
if(h>12||m>60||m>60)
{
printf("\nEnter correct time:\n");
}
printf("Mirror Time:\n");
if(h>=1&&h<=12&&m>=1)
{
h=12-h-1;
printf("%d",h);
}
else if(h>=1&&h<=12&&m==0)
{
h=12-h;
printf("%d",h);
}
if(m>=1&&m<=60)
{
m=60-m;
printf(":%d",m);
}
else if(m==0)
printf(":%d",m) ;
if(s>=1&&s<=60)
{
s=60-s;
printf(":%d",s);
}
else if(s==0)
printf(":%d",s) ;
getch();
}


OUTPUT-



5 comments

  1. c++ programming tutorial
    superb way of explaining, and great blog to get wonderful information.

    ReplyDelete

Related Posts Plugin for WordPress, Blogger...
Related Posts Plugin for WordPress, Blogger...
 

Most Reading

Labels