Header Ads

Hii,I am Anand Nayak.This blogger is make for specially basic programs of some language.

If statement

#include<iostream.h>
#include<conio.h>
void main()
{
      int h,m,s,r,add,div;
      clrscr();
       cout<<"enter your time";
      cin>>h>>m>>s;
     cout<<"enter increse second";
     cin>>add;
      s=s+add;
   if(s>=60)
   {
     div=s/60;
     s=s%60;
     m=m+div;
     }
   if(m>60)
   {
       div=m/60;
       m=m%60;
       h=h+div;
   }
     cout<<"now your time is"<<h<<":"<<m<<":"<<s<<endl;
 getch();
 }  

No comments