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-



2 comments

  1. Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a Java developer learn from Java Training in Chennai. or learn thru Java Online Training in India . Nowadays Java has tons of job opportunities on various vertical industry.


    or Javascript Training in Chennai. Nowadays JavaScript has tons of job opportunities on various vertical industry.

    ReplyDelete
  2. Matthew 22
    [35] Then one of them, which was a lawyer, asked him a question, tempting him, and saying, [36] Master, which is the great commandment in the law?

    Revelation 22
    [15]...and whosoever loveth and maketh a lie.

    FIND THE ANSWERS YOU SO DESPERATELY SEEK !
    >>>>>>>>>>>>>>>>>>>>>>>>>>>
    NEW TESTAMENT BIBLE STUDY
    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<


    Billionaires are BRILLIANT !

    scratchwiththechickens@gmail.com
    seeking benefactor

    !

    ReplyDelete

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

Most Reading

Labels