Write a program to input speed of Royal Enfield and check it's running at economic speed or not.
About Program
In this program we input a speed of Royal Enfield or any bike or car anything. In short we input a speed and check what is status of its speed means, is bike at economic speed???
For this program, logic is if speed less than 80 then we can say bike run at economic speed else this condition is false then we can say bike not run at economic speed. Let's Begin --
#include<stdio.h>
#include<conio.h>
void main()
{
int s;
clrscr();
printf("Enter speed of Royal Enfield=");
scanf("%d",&s);
if(s<80)
printf("\nRunning at economic speed");
else
printf("\nNot Running at economic speed ");
getch();
}
OUTPUT
Enter speed of Royal Enfield=76
Running at economic speed
OR
Enter speed of Royal Enfield=84
Not Running at economic speed
Related Examples
In this program we input a speed of Royal Enfield or any bike or car anything. In short we input a speed and check what is status of its speed means, is bike at economic speed???
For this program, logic is if speed less than 80 then we can say bike run at economic speed else this condition is false then we can say bike not run at economic speed. Let's Begin --
#include<stdio.h>
#include<conio.h>
void main()
{
int s;
clrscr();
printf("Enter speed of Royal Enfield=");
scanf("%d",&s);
if(s<80)
printf("\nRunning at economic speed");
else
printf("\nNot Running at economic speed ");
getch();
}
OUTPUT
Enter speed of Royal Enfield=76
Running at economic speed
OR
Enter speed of Royal Enfield=84
Not Running at economic speed
Related Examples
- Write a program to input length and width of a shape and find shape is square or rectangle.
- Write a program to input sell price and cost price and find transaction is profit or loss.
- Write a program to input age of any person and check he is eligible for voting or not.
- Write a program to input age of an employee and check he is retired or working.
Share and Comment.
Follow for recently updates.
Comments
Post a Comment