Program to Solve Time and Work Problems

C language programs can be written that can help us solve time and work problems that are asked in so many exams the world over.

Last Reviewed and Updated on May 17, 2017
Posted by Parveen(Hoven),
Aptitude Trainer and Software Developer


C++ Program for Time and Work Problems in Mathematical Ability

John can design a website in 8 days. Sam can do the same work in 5 days. Write a program to calculate the number of websites a company can produce in 30 days, if both Sam and John are employed together.

#include <iostream>
using namespace std;
int main()
    float johnPerDay = 1.0f / 8.0f;
    float samPerDay = 1.0f / 5.0f;
    float bothPerDay = johnPerDay + samPerDay;
    cout << "In 30 days: ";
    cout << (int)(30 * bothPerDay) << endl;
    return 0;

My C/C++ Videos on Youtube

Here is the complete playlist for video lectures and tutorials for the absolute beginners. The language has been kept simple so that anybody can easily understand them. I have avoided complex jargon in these videos.

Creative Commons License
This Blog Post/Article "Program to Solve Time and Work Problems" by Parveen (Hoven) is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
Updated on 2017-05-17.