Develop and execute C Program to Add Two Distances given in kilometer-meter Using Structures.

This post content:-
Algorithm
Flowchart
C code
Output
Pdf notes

Algorithm:- 
Step 1:- start.
Step 2:- declare structure for km and meter.(
struct Distance {
   int km;
   float m;
} d1, d2, result;)

Step 3:- take input of both distances.
Step 4:- add distances.
Step 5:- convert meter to km if greater than 1000
Step 5:- print the result.
Step 6:- END.

Flowchart :-
C code:-
Output:- 
Try it yourself:- online c compiler

Comments

Popular posts from this blog

Develop a c program to find the sum of all elements stored in a given array using a pointer.