JOIN us on
WhatsApp Group Join Now
Telegram Join Join Now

हिंदी माध्यम नोट्स

Class 6

Hindi social science science maths English

Class 7

Hindi social science science maths English

Class 8

Hindi social science science maths English

Class 9

Hindi social science science Maths English

Class 10

Hindi Social science science Maths English

Class 11

Hindi sociology physics physical education maths english economics geography History

chemistry business studies biology accountancy political science

Class 12

Hindi physics physical education maths english economics

chemistry business studies biology accountancy Political science History sociology

Home science Geography

English medium Notes

Class 6

Hindi social science science maths English

Class 7

Hindi social science science maths English

Class 8

Hindi social science science maths English

Class 9

Hindi social science science Maths English

Class 10

Hindi Social science science Maths English

Class 11

Hindi physics physical education maths entrepreneurship english economics

chemistry business studies biology accountancy

Class 12

Hindi physics physical education maths entrepreneurship english economics

chemistry business studies biology accountancy

Categories: c++ language in hindi

C++ : Example , Write a program to convert a height value in feet into feet value , BMI( body mass index )

इससे पहले C++ : Basic Examples (Part-1) ,मे c++ langue मे लिखे कुछ उदाह्रानो को discuss किया है | अब इस article मे हम कुछ और उदाहरानो को discuss करेगे | जिससे आपके C++ के सभी basic concept जैसे data type , arithmetic operator और syntax को अच्छी तरह समज सके |
उदाहरण- 1
Write a program to convert a height value in feet into feet value.
Explanation
सबसे पहले  दो variables को declare करते है | जिसमे एक का type integer और दूसरा का type float है |
उसके बाद यूजर से height value ( जो inch मे होगी ) को input करा लेगे | इसे variable name ‘h’
मे assign किया जाता है |
इसके बाद यूजर द्वारा input किये गये height value को feet मे convert करके variable h1 मे assign किया जाता है |
इसके बाद इन converted  value को cout statement से display करा लेते है |
Source Code
#include<iostream.h>
#include<conio.h>
void mian ()
{
using namespace std;
int h;
float h1;
cout<<“Enter height value (in Inch )  :”<<endl;
cin>>h;
h1=h*0.0833;
cout<<“Height value (in Foot )  : “<<h1<<endl;
getch();
}
इसका आउटपुट होगा :
Enter height value (in Inch )  : 6
Height value (in Foot )  : 0.50उदाहरण- 2
Write a program to calculate BMI( body mass index ).
Explanation
BMI( body mass index ) एक ration होता है जोकि weight in kilogram और height in foot से calculate किया जाता है | इस उदाहरण मे , यूजर से height को inch मे और weight को pound मे लिया जाता है | और बाद मे BMI को calculate किया जाता है |
सबसे पहले  दो variables को declare करते है | जिसमे height को inch मे और weight को pound की value को assign किया जाता है |
उसके बाद यूजर से height value ( जो inch मे होगी ) को input करा लेगे | इसे variable name ‘h’
मे assign किया जाता है और यूजर से weight value ( जो pound मे होगी ) को input करा लेगे | इसे variable name ‘w’ मे assign किया जाता है  |
इसके बाद यूजर द्वारा input किये गये height value को feet मे convert करके variable h1 मे assign किया जाता है | और यूजर द्वारा input किये गये weight value को kilogram  मे convert करके variable w1 मे assign किया जाता है |
उइसके बाद body mass index = weight value / height value  ; से BMI को calclaute किया जाता है |
इसके बाद इन BMI  value को cout statement से display करा लेते है |
Source Code
#include<iostream.h>
#include<conio.h>
void mian ()
{
using namespace std;
int h,w;
float h1,w1;
cout<<“Enter height value (in Inch )  :”<<endl;
cin>>h;
h1=h*0.0833;
cout<<“Height value (in Foot )  : “<<h1<<endl;
cout<<“Enter weight value (in Pound)  :”<<endl;
cin>>w;
w1=w/2.2;
cout<<“Weight value (in Kilogram )  : “<<w1<<endl;
float i= w1/hValue ;
cout<<“BMI Value “<<i;
getch();
}
इसका आउटपुट होगा :
Enter height value (in Inch )  : 6
Height value (in Foot )  : 0.50
Enter height value (in Pound )  : 6
Weight value (in Kilogram )  : 3.3
BMI Value =

उदाहरण-
Write a program to calculate car efficiency in miles per gallons. and convert it into Indian style ( kilogram per liter).
Explanation
car efficiency in miles per gallons एक ration होता है जोकि distance in miles  और oli capacity in gallon  से calculate किया जाता है | इस उदाहरण मे , यूजर से distance को  mile  मे और oil capacity को gallons मे लिया जाता है | और बाद मे miles per gallons को calculate किया जाता है |
सबसे पहले  दो variables को declare करते है | जिसमे distance value को mile मे और oil capacity को gallon  की value को assign किया जाता है |
उसके बाद यूजर से distance value ( जो mile मे होगी ) को input करा लेगे | इसे variable name ‘d’
मे assign किया जाता है और यूजर से oil capacity  value ( जो gallon मे होगी ) को input करा लेगे | इसे variable name ‘c’ मे assign किया जाता है  |
इसके बाद यूजर द्वारा input किये गये height value को kilogram  मे convert करके variable d1 मे assign किया जाता है | और यूजर द्वारा input किये गये oil capacity value को litres  मे convert करके variable c1 मे assign किया जाता है |
उइसके बाद से efficiency = distance value /oil capacity  value ;  को calculate किया जाता है |
इसके बाद इन efficiency value को cout statement से display करा लेते है |
Source Code
#include<iostream.h>
#include<conio.h>
void mian ()
{
using namespace std;
int d,c;
float d1,c1;
cout<<“Enter distance value (In Mile )  :”<<endl;
cin>>d;
d1=(d*100)/62.14;
cout<<“Distance value  (in Kilometer )  : “<<d1<<endl;
cout<<“Enter oil capacity  value (In gallon )  :”<<endl;
cin>c;
c1=c*3.875;
cout<<“oil capacity value (In Litres) : “<<w1<<endl;
float i= d1/c1 ;
cout<<” Efficiency Value “<<i;
getch();
}

उदाहरण- 4
Write a program to calculate square of a number .
Explanation
सबसे पहले  दो variables को declare करते है | जिसमे एक का type integer और दूसरा का type float है |
उसके बाद यूजर से  value  को input करा लेगे | इसे variable name ‘a’ मे assign किया जाता है |
इसके बाद यूजर द्वारा input किये गये value से square को calculate करके variable s मे assign किया जाता है |
इसके बाद इन square value को cout statement से display करा लेते है |
Source Code
#include<iostream.h>
#include<conio.h>
void main ()
{
using namespace std;
int a;
float s;
cout<<“Enter value  :”<<endl;
cin>>a;
s=a*a;
cout<<“Square value  : “<<s<<endl;
getch();
}
इसका आउटपुट होगा :
Enter value  : 3
Square value  : 9

उदाहरण- 5
Write a program to calculate cube of a number .
Explanation
सबसे पहले  दो variables को declare करते है | जिसमे एक का type integer और दूसरा का type float है |
उसके बाद यूजर से  value  को input करा लेगे | इसे variable name ‘a’ मे assign किया जाता है |
इसके बाद यूजर द्वारा input किये गये value से cube को calculate करके variable q मे assign किया जाता है |
इसके बाद इन cube value को cout statement से display करा लेते है |
Source Code
#include<iostream.h>
#include<conio.h>
void main ()
{
using namespace std;
int a;
float s;
cout<<“Enter value  :”<<endl;
cin>>a;
s=a*a*a;
cout<<“Cube value  : “<<s<<endl;
getch();
}
इसका आउटपुट होगा :
Enter value  : 3
Cube value  : 27

Sbistudy

Recent Posts

द्वितीय कोटि के अवकल समीकरण तथा विशिष्ट फलन क्या हैं differential equations of second order and special functions in hindi

अध्याय - द्वितीय कोटि के अवकल समीकरण तथा विशिष्ट फलन (Differential Equations of Second Order…

17 hours ago

four potential in hindi 4-potential electrodynamics चतुर्विम विभव किसे कहते हैं

चतुर्विम विभव (Four-Potential) हम जानते हैं कि एक निर्देश तंत्र में विद्युत क्षेत्र इसके सापेक्ष…

4 days ago

Relativistic Electrodynamics in hindi आपेक्षिकीय विद्युतगतिकी नोट्स क्या है परिभाषा

आपेक्षिकीय विद्युतगतिकी नोट्स क्या है परिभाषा Relativistic Electrodynamics in hindi ? अध्याय : आपेक्षिकीय विद्युतगतिकी…

5 days ago

pair production in hindi formula definition युग्म उत्पादन किसे कहते हैं परिभाषा सूत्र क्या है लिखिए

युग्म उत्पादन किसे कहते हैं परिभाषा सूत्र क्या है लिखिए pair production in hindi formula…

1 week ago

THRESHOLD REACTION ENERGY in hindi देहली अभिक्रिया ऊर्जा किसे कहते हैं सूत्र क्या है परिभाषा

देहली अभिक्रिया ऊर्जा किसे कहते हैं सूत्र क्या है परिभाषा THRESHOLD REACTION ENERGY in hindi…

1 week ago
All Rights ReservedView Non-AMP Version
X

Headline

You can control the ways in which we improve and personalize your experience. Please choose whether you wish to allow the following:

Privacy Settings
JOIN us on
WhatsApp Group Join Now
Telegram Join Join Now