Program To Convert NST Nepali time to GMT ( C++ ) using Object Class Concept
#include<iostrem.h>
#include<conio.h>
class time
{
public: int h,m,s;
void enternptime()
{
cout<<"enter the time of Nepal in 24 hours Format";
cin>>h>>m>>s;
}
};
void main()
{
clrscr();
time a,b;
a.enternptime();
b.h=a.h+5;
b.m=a.m+45;
if(b.m>60)
{
b.h=b.h+1;
b.m=b.m-60;
}
if(b.m>24)
{
b.m=24-b.m;
}
cout<<" the time in GMT is"<<b.h<<":"<<b.m<<":"<<b.s;
getch();
}
#include<iostrem.h>
#include<conio.h>
class time
{
public: int h,m,s;
void enternptime()
{
cout<<"enter the time of Nepal in 24 hours Format";
cin>>h>>m>>s;
}
};
void main()
{
clrscr();
time a,b;
a.enternptime();
b.h=a.h+5;
b.m=a.m+45;
if(b.m>60)
{
b.h=b.h+1;
b.m=b.m-60;
}
if(b.m>24)
{
b.m=24-b.m;
}
cout<<" the time in GMT is"<<b.h<<":"<<b.m<<":"<<b.s;
getch();
}
No comments:
Post a Comment
its cool