Code:
#include<stdio.h>
#include<iostream>
using namespace std;
class time
{
private:
int hours;
int minutes;
int seconds;
int sum;
//static int count;
public:
time()
{
hours=10;
minutes=10;
seconds=10;
sum=0;//count=0;
//count++;
}
time(int var1,int var2,int var3)
{
hours=var1;
minutes=var2;
seconds=var3;
}
void showtime()
{
cout<<hours<<":"<<minutes<<":"<<seconds<<" count is "<<endl;
}
void power()
{
int pow=1;
for(int i=0;i<=10;i++)
pow=pow*2;
cout<<pow<<endl;
}
void power(int var1)
{
int pow=1;
for(int i=0;i<=10;i++)
pow=pow*var1;
cout<<pow<<endl;
}
/* int power(int var3)
{
int pow=1;
for(int j=0;j<=10;j++)
pow=pow*var3;
return pow;
}*/
void power(int var2,float var3)
{
int pow=1;
float val=0.0;
for(int i=0;i<=10;i++)
pow=pow*var2;
val=pow*var3;
cout<<val<<endl;
}
void power(float var4)
{
float pow=1.0;float val2;
for(int i=0;i<=10;i++)
pow=pow*var4;
val2=pow*2.0;
cout<<"value is"<<val2<<endl;
}
void func2();
};
void time::func2()
{
cout<<"you are in function 2"<<endl;
}
int main()
{
time t1;int var1=3,var4;float val3=2.0;
//t1.showtime();
time t2;
time t3,t4;
//t4.showtime();
t1.func2();
//.power();
//.power(var1);
//.power(2,3.0);
//.power(val3);
return 0;
}