Skip to content

Commit 0027b19

Browse files
authored
Merge pull request #621 from vishnu1295/brancho
Rule of three
2 parents eed329e + 64e062c commit 0027b19

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

rule_of_three/rule_of_three.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#include<bits/stdc++.h>
2+
3+
using namespace std;
4+
5+
int main()
6+
{
7+
cout<<"Rule of three\n";
8+
cout<<"For an equation of the form :\n";
9+
cout<<"a ->b\n";
10+
cout<<"x ->c\n";
11+
cout<<"where x is unknown\n";
12+
int a,b,c,x;
13+
cout<<"Please enter value of a b c ";
14+
cin>>a>>b>>c;
15+
x=(a*c)/b;
16+
cout<<"Value of x is:"<<x;
17+
return 0;
18+
}
19+

0 commit comments

Comments
 (0)