actions / actions/starter-workflows
Conversion some physical quantity
Open
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 12.1k
- Forks
- 7.3k
- PR merge metrics
- No merged PRs in 30d
Description
#include <stdio.h>
int main() {
float first, second;
char input;
// Conversion factors
float kmsToMiles = 0.621371;
float inchesToFoot = 0.0833333;
float inchesTocm=2.54;
float kmTom=1000;
while (1) {
printf("\nEnter the input character. q to quit\n");
printf("1. kms to miles\n");
printf("2. inches to foot\n");
printf("3. inches to cm\n");
printf("4. km to m\n");
scanf(" %c", &input); // Note: space before %c to handle newline
switch (input) {
case 'q':
printf("Quitting the program...\n");
return 0;
case '1':
printf("Enter quantity in kms: ");
scanf("%f", &first);
second = first * kmsToMiles;
printf("%f Kms is equal to %f Miles\n", first, second);
break;
case '2':
printf("Enter quantity in inches: ");
scanf("%f", &first);
second = first * inchesToFoot;
printf("%f Inches is equal to %f Foot\n", first, second);
break;
case '3':
printf("Enter quantity in inches: ");
scanf("%f", &first);
second = first * inchesTocm;
printf("%f Inches is equal to %f cm\n", first, second);
break;
case '4':
printf("Enter quantity in km: ");
scanf("%f", &first);
second = first * kmTom;
printf("%f km is equal to %f m\n", first, second);
break;
default:
printf("Invalid input, try again!\n");
}
}
return 0;
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue contains only a standalone C program and does not name a repository file, test, entry point, or requested change. Start by clarifying whether this physical-quantity conversion program belongs in starter-workflows and what contribution is expected; done requires an explicit target and acceptance criteria.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 15/100