answersLogoWhite

0


Best Answer

#include <stdio.h>

#include <time.h>

int main()

{

time_t start_time;

time_t stop_time;

int e;

clrscr();

printf( "Type the Enter key to START timing.\n");

while(getchar()!='\n');

start_time=time(NULL);

printf( "Type the Enter key to STOP timing.\n");

while(getchar()!='\n');

stop_time=time(NULL) ;

e=difftime( stop_time,start_time);

printf( "Elapsed time: %d seconds.\n" ,e) ;

getch();

}

User Avatar

Wiki User

14y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

12y ago

#include "stdio.h"

#include "conio.h"

#include "dos.h"

void main()

{

int h,m,s;

h=0;

m=0;

s=0;

while(1)

{

if(s>59)

{

m=m+1;

s=0;

}

if(m>59)

{

h=h+1;

m=0;

}

if(h>11)

{

h=0;

m=0;

s=0;

}

delay(1000);

s=s+1;

clrscr();

printf("\n DIGITAL CLOCK");

printf("\n HOUR:MINUTE:SECOND");

printf("\n%d:%d:%d",h,m,s);

}

}

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What are the algorithm in stopwatch c language?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

How do you RSA algorithm c?

Perform encryption on the following PT using RSA and find the CT p = 3; q = 11; M = 5


Does every algorithm have a c program?

Yes. More generally, every algorithm (defined as a sequence of finite steps to solve a problem that can be easily understood by a human) can be converted into machine code such that the algorithm can be understood by a machine. The C programming language is just one such method of converting algorithms into working machine code.


How can you implement Ricart and Agrawala's algorithm in c?

Ronaldo! 'c' coding of Ricart-agarwala algorithm


How to write algorithm in c program?

Algorithms are created using pseudocode, which is a combination of natural language (such as English) and commonly understood programming concepts. Pseudocode is a machine-independent language, but it is far too abstract for a machine to understand. It is intended for humans only. As programmers, our job is to translate these algorithms into a form the machine can process in order to produce the required machine-dependent code. For this we use programming languages, such as C, C++ and Java. The more abstract the programming language, the easier it is to convert an algorithm into working code. Of all the high-level programming languages, C has the least amount of abstraction, however we can make use of third party libraries to increase the amount of abstraction, or we can use the language itself to create our own abstractions.


C code to implement the file allocation algorithm?

yes we can do it,in c

Related questions

How do you write an Algorithm for a C plus plus Program?

You don't write an algorithm for a C++ program, unless you are documenting the C++ program after-the-fact. The normal procedure is to write the algorithm first, in a language independent fashion, and then translate that stated algorithm into C++ code, or into whatever language you wish.


How do you write algorith of C programs?

There is no specific Hard and Fast rule for writing algorithm. The normal method is the following: 1. get a problem 2. find or invent an algorithm to solve it 3. implement the algorithm in a programming language (C, for example)


How do you RSA algorithm c?

Perform encryption on the following PT using RSA and find the CT p = 3; q = 11; M = 5


Does every algorithm have a c program?

Yes. More generally, every algorithm (defined as a sequence of finite steps to solve a problem that can be easily understood by a human) can be converted into machine code such that the algorithm can be understood by a machine. The C programming language is just one such method of converting algorithms into working machine code.


Algorithm is written in which language?

what language is algorithms written in?


How can you implement Ricart and Agrawala's algorithm in c?

Ronaldo! 'c' coding of Ricart-agarwala algorithm


What is algorithm in c?

Algorithm is a step by step process to solve a particular task.


What is algorithm write properties of algorithm?

An ALGORITHM is a sequence of steps that depicts the program logic independent of the language in which it is to be implemented. An algorithm should be designed with space and time complexities in mind.


What is an algorithm for multiplying rational numbers?

The algorithm is A/B * C/D = AB/CD.


How to write algorithm in c program?

Algorithms are created using pseudocode, which is a combination of natural language (such as English) and commonly understood programming concepts. Pseudocode is a machine-independent language, but it is far too abstract for a machine to understand. It is intended for humans only. As programmers, our job is to translate these algorithms into a form the machine can process in order to produce the required machine-dependent code. For this we use programming languages, such as C, C++ and Java. The more abstract the programming language, the easier it is to convert an algorithm into working code. Of all the high-level programming languages, C has the least amount of abstraction, however we can make use of third party libraries to increase the amount of abstraction, or we can use the language itself to create our own abstractions.


C code to implement the file allocation algorithm?

yes we can do it,in c


Can you give a C program about SJF algorithm?

no.