Clock program Using C++, Assignments of Computer Science

Here is the c++ clock program. this is a digital clock

Typology: Assignments

2019/2020

Uploaded on 04/24/2020

maryum-noor
maryum-noor 🇵🇰

1 document

1 / 4

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
FINAL PROJECT
CLOCK PROGRAM USING
NESTED LOOP
#include <iostream>
#include <windows.h>
using namespace std;
int main()
{
int minutes = 0;
int hours = 5;
Loop:
for (int a = 0; a < 61; a++)
{
if (a == 60)
{
minutes = minutes + 1;
a = a - 60;
goto Loop;
}
if (minutes == 60)
{
hours = hours + 1;
minutes = 0;
FINAL SEMESTER PROJECT
Header File iostream &
window
When The Seconds Become
60
Then There Is Increase In
Minutes That Is An Increment
And so on
Using For loop for Seconds
Range From 0 To Less Than 61
That is 60
Initialization of
Minutes & hours
When The Minutes
Become 60 Then There Is
Increase In Hours And So
On…
Main Function
Page
1
pf3
pf4

Partial preview of the text

Download Clock program Using C++ and more Assignments Computer Science in PDF only on Docsity!

FINAL PROJECT

CLOCK PROGRAM USING

NESTED LOOP

#include

#include <windows.h>

using namespace std;

int main()

int minutes = 0;

int hours = 5;

Loop:

for (int a = 0; a < 61; a++)

if (a == 60)

minutes = minutes + 1;

a = a - 60;

goto Loop;

if (minutes == 60)

hours = hours + 1;

minutes = 0;

FINAL SEMESTER PROJECT Header File iostream & window When The Seconds Become 60 Then There Is Increase In Minutes That Is An Increment And so on… Using For loop for Seconds Range From 0 To Less Than 61 That is 60 Initialization of Minutes & hours When The Minutes Become 60 Then There Is Increase In Hours And So On… Main Function Page

goto Loop;

if (hours == 13)

hours = hours - hours;

hours = hours + 1;

system("cls");

cout <<"Hours:"<<hours<<"/ Minutes:"<<minutes<<"/

Seconds:"<<a;

Sleep(1000);

return 0;

PROGRAM FINAL SEMESTER PROJECT Printing The Values of Hours, Minutes & Seconds In Output It Stops When it Runs 1000 Times We Know Hours Are 12 So When it Reached to 13 Then Hours Becomes 0 & Then 0+ Page

Output: FINAL SEMESTER PROJECT (^) Page