This programme is supposed to calculate and display the appropriate number of seconds but it doesn't
//Define the unknown?
#include <iostream>
using namespace std;
int main ( )
{ cout << "There are 60 seconds in a minute." << endl;
cout << "There are XXX seconds in an hour." << endl;
cout << "There are YYY seconds in a day." << endl;
cout <<"There are ZZZ seconds in a year." << endl;
return 0; }
Well, if you write the code it can do almost anything you like. The code that you pasted into the start of this thread appears to be what you tutor has given you. You need to add the code so that you replace the 'XXX', 'YYY' and 'ZZZ' with the correct calculated values. You should be able to do that surely?
How many seconds are there in an hour? Hint: how many seconds in a minute, and how many minutes are there in an hour? Multiple the two together.
This is what i tried last night but still could not come right.
// What will be the outcome?
#include <iostream>
using namespace std;
int main( )
{ cout << "There are 60 seconds in a minute." << endl;
cout << "There are XXX seconds in an hour. The product of 60 * 60 is " << endl;
cout << "XXX seconds";
cout << "There are YYY seconds in a day.";
cout << "YYY seconds * 24 hours is 1 day" <<endl;
cout << "There are ZZZ seconds in a year.";
cout << "ZZZ seconds * 365 days is 1 year";
return 0; }
Hello! I kindly ask for some help. I just had my first lab class of C language and I had this homework. I don't know what's wrong about it, since it has errors. Thank you :)
#include<studio.h>
#include <stdlib.h>
#include <math.h>
typedef struct
{
int Coef;
unsigned int Exponent;
}TMonom;
int main()
{
typedef TMonom[50] TPolinom;
int x;
int n;
scanf("x=%d/n",x);
scanf("n=%d/n",n);