C Exercise 2: Units and Conversions: C Tutorial In Hindi #22

18
38


In this series of C programming tutorial videos, I have explained you everything you need to know about C language. I hope you are enjoying this C course in Hindi.
►This C Lecture is a part of this C Programming In Hindi Course:
►Source Code + Other Info:
►Click here to subscribe –

Best Hindi Videos For Learning Programming:

►Learn Python In One Video –

►Learn JavaScript in One Video –

►Learn PHP In One Video –

►Machine Learning Using Python –

►Creating & Hosting A Website (Tech Blog) Using Python –

►Advanced Python Tutorials –

►Object Oriented Programming In Python –

►Python Data Science and Big Data Tutorials –

Follow Me On Social Media
►Website (created using Flask) –
►Facebook –
►Instagram (Guaranteed Replies :)) –
►Personal Facebook A/c –
Twitter –

Subscribe Our Youtube Channel: https://healthandfitnessrecipes.com/youtube

Follow us on Pinterest: https://www.pinterest.com/healthandfitnessrecipes

Follow us on Twitter: https://www.twitter.com/handfrecipes

Follow us on Facebook: https://www.facebook.com/healthandfitnessrecipes101

Follow us on Instagram: https://www.instagram.com/healthandfitnessrecipes



source

18 COMMENTS

  1. #include<stdio.h>

    int main(){
    char ch;
    float result;
    float input;
    do
    {
    printf("Please select an option from given belownn");
    printf("a) Kilogram to Poundn");
    printf("b) Celsius to Farenheitn");
    printf("c) Foot to Centimetersn");
    printf("d) Kilometer to milesn");
    printf("Press q to quit.n");
    scanf(" %c", &ch);
    switch (ch)
    {
    case 'a':
    printf("Please enter the value in Kilogramn");
    scanf("%f",&input);
    result = 2.204 * input;
    printf("Your result is %0.2f poundn", result);
    break;

    case 'b':
    printf("Please enter the value in Celsiusn");
    scanf("%f",&input);
    result = (9.0/5.0) * input + 32;
    printf("Your result is %0.2f Farenheitn", result);
    break;

    case 'c':
    printf("Please enter the value in Footn");
    scanf("%f",&input);
    result = 30.48 * input;
    printf("Your result is %0.2f centimetern", result);
    break;

    case 'd':
    printf("Please enter the value in Kilometersn");
    scanf("%f",&input);
    result = 0.6213 * input;
    printf("Your result is %0.2f milesn", result);
    break;

    default:
    break;
    }

    } while (ch !='q');

    return 0;
    }

  2. Harry bhai aap ne reply nahi kiya last video me mere comment ka please is bar reply karo mera question ye hai =
    harry bhai appka djnago ecommerce tutorial me login system nahi hai please add karo osh pe ek video bnao, q ki maine banya to ache se work nahi kar rha hai please harry bhai ek video bnao jisme signup and login ho, and login karne ke baad hi koi bhi shopping kar ske

  3. /*
    kms to miles
    inches to foot
    cms to inches
    poubd to kgs
    inches to meturs
    */
    #include <stdio.h>
    #include <conio.h>

    void menu()
    {
    printf("1. kms to miles n");
    printf("2. inches to foot n");
    printf("3. cms to incles n");
    printf("4. pounds to kgs n");
    printf("5. inches to miturs n");
    printf("6. exit");
    }

    void KAM()
    {
    int i;
    float km,mile;

    printf("1. km to mile n");
    printf("2. mile to km n");

    printf(" Enter any one choice = ");
    scanf("%d",&i);

    if(i==1)
    {
    printf("Enter distence in km = ");
    scanf("%f",&km);

    mile=km*0.621;
    printf("n %f km = %f miles",km,mile);

    }
    else if(i==2)
    {
    printf("Enter distence in mile = ");
    scanf("%f",&mile);

    km=mile*1.609;
    printf("n %f km = %f miles",km,mile);

    }
    else
    {
    printf("n Enter valid(1 or 2) choice");
    }
    }

    void IAF()
    {
    int i;
    float inch,feet;
    printf("1. inch to feet n");
    printf("2. feet to inch n");

    printf("Enter any one choice = ");
    scanf("%d",&i);

    if(i==1)
    {
    printf("n Enter distence in inch = ");
    scanf("%f",&inch);

    feet=inch*0.0833;
    printf("n %f inch = %f feet");

    }
    else if(i==2)
    {
    printf("n Enter distence in feet = ");
    scanf("%f",&feet);

    inch=feet*12;
    printf("n %f feet = %f inches",feet,inch);

    }
    else
    {
    printf("n Enter valid(1 or 2) choice");
    }
    }

    void CAI()
    {
    int i;
    float cm,inch;

    printf("1. cm to inch n");
    printf("2. inch to cm n");

    printf("Enter any one choice = ");
    scanf("%d",&i);

    if(i==1)
    {
    printf("Enter distence in cm n ");
    scanf("%f",&cm);

    inch=cm*0.0328;
    printf("%f cm = %f inches");

    }
    else if(i==2)
    {
    printf("Enter distence in inch");
    scanf("%d",&inch);

    cm=inch*2.54;
    printf("%f inch = %f cm");

    }
    else
    {
    printf("n Enter valid(1 or 2) choice");
    }

    }

    void PAK()
    {
    int i;
    float pound,kg;

    printf("1. pound to kg n");
    printf("2. kg to pound n");

    printf("Enter any one choice = ");
    scanf("%d",&i);

    if(i==1)
    {
    printf("Enter weight in pound = ");
    scanf("%f",&pound);

    kg = pound*0.4535;
    printf("%f pounds = %f kg",pound,kg);

    }
    else if(i==2)
    {
    printf("Enter weight in kg = ");
    scanf("%f",&kg);

    pound = kg*0.4535;
    printf("%f kg = %f pound",kg,pound);
    }
    else
    {
    printf("n Enter valid(1 or 2) choice");
    }

    }
    void IAM()
    {
    int i;
    float inch,miture;

    printf("1. inch to miture");
    printf("2. miture to inch");

    printf("Enter any one choice = ");
    scanf("%d",&i);

    if(i==1)
    {
    printf("Enter distence in inch = ");
    scanf("%d",&inch);

    miture=inch*0.02540;
    printf("%f inch = %f miture",inch,miture);

    }
    else if(i==2)
    {
    printf("Enter distence in miture = ");
    scanf("%f",miture);

    inch= miture*39.370;
    printf("%f miture = %f inch",miture,inch);

    }
    else
    {
    printf("n Enter valid(1 or 2) choice");
    }

    }

    int main()
    {
    while(1)
    {
    int i;
    clrscr();
    menu();

    printf("n enter any one choice = ");
    scanf("%d",&i);

    switch(i)
    {
    case 1 :
    KAM();
    break;

    case 2 :
    IAF();
    break;

    case 3 :
    CAI();
    break;

    case 4 :
    PAK();
    break;

    case 5 :
    IAM();
    break;

    case 6 : goto ak;

    default :
    printf("n Enter valid(1 to 5) choice");
    }
    getch();
    }
    ak:
    getch();
    }

  4. challenge accepted
    #include <stdio.h>

    #include <math.h>

    #include <stdlib.h>

    int main()

    {

    int a, b, c, choice, m, i, k, kg, po,ne;

    float ml, km, in, cm, gm, inc, kmo;

    printf("Input [%d] number for additionnn", 1);

    printf("Input [%d] number for substractionnn", 2);

    printf("Input [%d] number for multiplicationnn", 3);

    printf("Input [%d] number for divisionnn", 4);

    printf("Input [%d] number for find squarerootnn", 5);

    printf("Input [%d] for convert kilometer into milesnn", 6);

    printf("Input [%d] for convert miles into kilometernn", 7);

    printf("Input [%d] for convert inches into meternn", 8);

    printf("Input [%d] for convert inches into centimeter and cm into inchesnn", 9);

    printf("Input [%d] for convert kilogram into gramnn", 10);

    printf("Input [%d] for convert pounds into kilogramnn", 11);

    printf("EXIT [%d]nn", 12);

    printf("—————————————————————————-nn");

    while (1)

    {

    printf("nnInput the number operation that you perform : n");

    scanf("%d", &choice);

    switch (choice)

    {

    case 1:

    printf("nInput number for addition : n");

    scanf("%d%d", &a, &b);

    printf("%d+%d=%d", a, b, (a + b));

    break;

    case 2:

    printf("nInput number for substraction : n");

    scanf("%d%d", &a, &b);

    printf("%d-%d=%d", a, b, (a – b));

    break;

    case 3:

    printf("nInput number for multiplication : n");

    scanf("%d%d", &a, &b);

    printf("%d*%d=%d", a, b, (a * b));

    break;

    case 4:

    printf("nInput number for division : n");

    scanf("%d%d", &a, &b);

    printf("%d/%d=%d", a, b, (a / b));

    break;

    case 5:

    printf("nInput number for find square root : n");

    scanf("%d", &a);

    c = sqrt(a);

    printf("The square root of %d is %d", a, c);

    break;

    case 6:

    printf("nInput number for convert kilometer into miles: n");

    scanf("%d", &a);

    ml = a * 0.621371;

    printf("kilometer into miles %d is %fn", a, ml);

    break;

    case 7:

    printf("nInput number for convert miles into kilometer: n");

    scanf("%d", &m);

    km = m * 1.60934;

    printf("Miles into kilometer %d is %fn", m, km);

    break;

    case 8:

    printf("nInput number for convert inch into meter: n");

    scanf("%d", &i);

    in = i * 0.0254;

    printf("Inch into meter %d is %fn", i, in);

    break;

    case 9:

    printf("nInput number for convert inch into centimeter: n");

    scanf("%d", &k);

    cm = k * 2.54;

    printf("Inch into centimeter %d is %fn", k, cm);

    printf("Input the number for convert centimeter into inche: n");

    scanf("%d", &ne);

    inc = ne * 0.393701;

    printf("centimeter into inch %d is %fn", ne, inc);

    break;

    case 10:

    printf("nInput number for convert kilogram into gram: n");

    scanf("%d", &kg);

    gm = kg * 1000;

    printf("Kilogram into gram %d is %fn", kg, gm);

    break;

    case 11:

    printf("nInput number for convert pounds into kilogram: n");

    scanf("%d", &po);

    kmo = po * 0.453592;

    printf("Pounds into kilogram %d is %fn", po, kmo);

    break;

    case 12:

    exit(12);

    default:

    printf("nInvalid choice try something different number : n");

    break;

    }

    }

    }

    bro meri mistakes batana mai abhi coding me naya hu

  5. #include <stdio.h>
    #include <stdlib.h>
    int main()
    {
    int ch;
    float km,inch,pound,feet,kgs,meter,miles;
    while(1){
    printf("n*******Unit Conversions Menu:******n");

    printf(" 1. Kilometer to milesn 2. inches to feet n 3. pound to Kilogram(kg)n 4. inches to metersn 5. Quitnn");
    printf("Enter Your Conversion Menu No.:n");
    scanf("%d",&ch);

    switch(ch){

    case 1:
    printf("Enter Kilometer :n");

    scanf("%f",&km);
    miles=km * 0.62137;
    printf("Kilometer to Miles value: %fn",miles);
    break;

    case 2:
    printf("Enter Inches:n");
    scanf("%f",&inch);
    feet=inch * 0.083333;
    printf("Inches to Feet value: %fn",feet);
    break;

    case 3:
    printf("Enter Pounds:n");
    scanf("%f",&pound);
    kgs=pound * 0.453592;
    printf("Pound to Kilogram value: %fn",kgs);

    break;

    case 4:
    printf("Enter Inches:n");
    scanf("%f",&inch);
    meter=(inch/39.370);
    printf("Inches to Meter value: %fn",meter);
    break;

    case 5:
    printf("Thanks……….quit Your Code.n");
    exit(1);
    break;

    default: printf("********Enter Correct Menu!!!!!!!*****n");
    //exit(0);
    }
    }
    return 0;

    }

LEAVE A REPLY

Please enter your comment!
Please enter your name here