oh come on, it cant get any simpler than [URL="

nothing weird in my compiler; just got a simple textbox saying hello world. used visual c++ 2010.

That was cool. But you know what, it would be super cool if u explain the code too, because i have a doubt that even you can understand that.

murtazamzk commented: doubting +0

[QUOTE=WaltP;1419149]And your question about this poor code is... what?[/QUOTE]
hi...why is the code poor? i mean, i didn't even know we could shutdown the pc using c.
can u please tell me a (better) way? Thanks

[QUOTE=flasp;1409886]ty very much...[/QUOTE]
Please mark the threads solved when you're finished with the problem.
Thanks

The program converts number of hours into days.
after this, try to code that inputs number of minutes and converts in x days y hours & z minutes.
then u can easily work with seconds.
[CODE]
/*

  • Input: Number of Hours 'H'
  • Output: 'H' hours = 'X' Days and 'Y' Hours
    */
    include <iostream>

    using namespace std ;

void main()
{
int days, hours ;
int long inputHours ;
cout << "Enter Number Of Hours: " ;
cin >> inputHours ;
days = inputHours / 24 ; //Quotient(Days)
hours = inputHours % 24 ; //Remainder(Hours)
cout << days << "Days and " << hours << "Hours" << endl ;
system ("pause");
}
[/CODE]

flasp commented: very helpfull +1

[QUOTE]Lol ok guys, I try to fix it tonight .[/QUOTE]
That' Better

[QUOTE=flasp;1409547]Done that, and doesnt come up with correct result.. I hope someone can help me with making the code?[/QUOTE]
I have the code but won't post it unless you show what you tried.
Come on, just give it a shot.

[QUOTE=xikkub;1408726]Following standard programming conventions, it's undesirable to use global variables where locals will do. Use less output and text formatting. Remove unnecessary cout lines and simplify your code before adding final touches. If you simplify the code and learn how to [U]pass data to a function[/U], you can make your work much easier.

Also, Jason, declaring a character array of 10 is NOT a good idea in this case since the day name length can vary. If anything, I'd use a dynamic character array.[/QUOTE]
I just wanted to demonstrate use of array, size needn't be fixed. I was giving an idea how cout can be reduced.
also, thanks for the fact about the global variables, i'll keep that in mind.

Try generalising the program using global variables. instead of using so many cout statements printing the same thing, use one cout and the variables(which will have different values acc to time and day). use a func to calc the values of variables.
EX

[CODE]char day[10];
switch(chday)
{
case 'M':
day = "Monday";
break;
case 'U':
day = "tuesday"
cout<<"\n\n";
break;
case 'W':
day = "wednesday"
break;

    default: cout<<"Error";

}
cout << "The Call Was Made On " << day << endl ;[/CODE]

a