C C++ program to convert hours into minutes and seconds

Write a C C++ program to convert hours into minutes and seconds

C Language की विशेषताओं एवं शक्तियों को जानने के लिए देखें—Features and Powers of C

C Language में Character set क्या होता है जानने के लिए देखें—Character set of C

Flowchart to convert hours into minutes and seconds

Flowchart to convert hours into minutes and seconds

C program to convert hours into minutes and seconds

#include<stdio.h>
int main()
{
    float h,m,s;
    printf("Enter time in hours: ");
    scanf("%f",&h);
    m=h*60;
    s=h*3600;
    printf("Minutes = %f Seconds = %f",m,s);
    return 0;
}

C++ program to convert hours into minutes and seconds

#include<iostream>
using namespace std;
int main()
{
    float h,m,s;
    cout<<"Enter time in hours: ";
    cin>>h;
    m=h*60;
    s=h*3600;
    cout<<"Minutes = "<<m<<" Seconds = "<<s;
    return 0;
}

Output of C C++ program to convert hours into minutes and seconds

Enter time in hours: 2
Minutes = 120 Seconds = 7200
Enter time in hours: 5
Minutes = 300 Seconds = 18000

Similar important programs in C C++

  1. Sum of two entered numbers
  2. Average of three entered numbers
  3. Simple interest
  4. Total and Percent
  5. Swapping values of two variables
  6. Swapping without using third variable
  7. Celsius to Fahrenheit conversion
  8. Find area and circumference of circle
Share it to:

C C++ program to find area and circumference of Circle

C C++ program to find area and circumference of Circle

Procedure Oriented Programming (POP) और Object Oriented Programming (OOP) में अंतर जानने के लिए देखें—POP vs OOP

Object Oriented Programming (OOP) की विभिन्न अवधारणाओं को जानने के लिए देखें—Concepts of OOP

Flowchart to find area and circumference of Circle

Flowchart to find area and circumference of Circle

C program to find area and circumference of Circle

#include<stdio.h>
int main()
{
    float r,a,c;
    printf("Enter radius: ");
    scanf("%f",&r);
    a=3.14*r*r;
    c=2*3.14*r;
    printf("Area = %f",a);
    printf("\nCircumference = %f",c);
    return 0;
}

C++ program to find area and circumference of Circle

#include<iostream>
using namespace std;
int main()
{
    float r,a,c;
    cout<<"Enter radius: ";
    cin>>r;
    a=3.14*r*r;
    c=2*3.14*r;
    cout<<"Area = "<<a<<endl;
    cout<<"Circumference = "<<c<<endl;
    return 0;
}

Output of C C++ program to find area and circumference of Circle

Enter radius: 5
Area = 78.500000
Circumference = 31.400000
Enter radius: 12.5
Area = 490.874000 
Circumference = 78.539800   

Similar most common programs in C C++

  1. Sum of two entered numbers
  2. Average of three entered numbers
  3. Simple interest
  4. Total and Percent
  5. Swapping values of two variables
  6. Swapping without using third variable
  7. Celsius to Fahrenheit conversion
Share it to:

Write a C C++ program to convert from Celsius to Fahrenheit

Write a C C++ program to convert from Celsius to Fahrenheit

C Language के बारे में अधिक जानने के लिए देखें—Brief Introduction of C

C Language की विशेषताओं एवं शक्तियों को जानने के लिए देखें—Features and Powers of C

Flowchart to convert from Celsius to Fahrenheit

Centigrade to Fahrenheit conversion flowchart

C program to convert from Celsius to Fahrenheit

#include<stdio.h>
int main()
{
    float c,f;
    printf("Enter temperature in celsius: ");
    scanf("%f",&c);
    f = 32+(c*9)/5;
    printf("Temperature in fahrenheit = %f",f);
    return 0;
}

C++ program to convert from Celsius to Fahrenheit

#include<iostream>
using namespace std;
int main()
{
    float c,f;
    cout<<"Enter temperature in celsius: ";
    cin>>c;
    f = 32+(c*9)/5;
    cout<<"Temperature in fahrenheit = "<<f;
    return 0;
}

Output of C C++ program to convert from Celsius to Fahrenheit

Enter temperature in celsius: 37
Temperature in fahrenheit = 98.599998
Enter temperature in celsius: 50
Temperature in fahrenheit = 122.000000

Other related C C++ programs

  1. Sum of two entered numbers
  2. Average of three entered numbers
  3. Simple interest
  4. Total and Percent
  5. Swapping values of two variables
  6. Swapping without using third variable
  7. Find area and circumference of circle
Share it to:

Write a C C++ program to swap without using third variable

Write a C C++ program to swap without using third variable

C Language में उपलब्ध Operators और इनके विभिन्न प्रकारो को जानने के लिए देखें—Operators in C

C-Language में Operator Precedence और Associativity Rule क्या होता है जानने के लिए देखें— Precedence and Associativity in C

Flowchart to swap without using third variable

Swapping without using third variable flowchart

C program to swap without using third variable

#include<stdio.h>
int main()
{
    int a,b;
    printf("Enter a b: ");
    scanf("%d%d",&a,&b);
    a = a+b;
    b = a-b;
    a = a-b;
    printf("a = %d b = %d",a,b);
    return 0;
}

C++ program to swap without using third variable

#include<iostream>
using namespace std;
int main()
{
    int a,b;
    cout<<"Enter a b: ";
    cin>>a>>b;
    a = a+b;
    b = a-b;
    a = a-b;
    cout<<"a = "<<a<<" b = "<<b;
    return 0;
}

Output of C C++ program to swap without using third variable

Enter a b : 10 20
a = 20 b = 10
Enter a b : 18 77
a = 77 b = 18

More C and C++ programs

  1. Sum of two entered numbers
  2. Average of three entered numbers
  3. Simple interest
  4. Total and Percent
  5. Swapping values of two variables
  6. Celsius to Fahrenheit conversion
  7. Find area and circumference of circle
Share it to:

Write a C C++ program to swap values of two variables

Write a C C++ program to swap values of two variables

C Language में Data type क्या होता है जानने के लिए देखें—Data types in C

C Language में उपलब्ध Operators और इनके विभिन्न प्रकारो को जानने के लिए देखें—Operators in C

Flowchart to swap values of two variables

Swapping values of two variables flowchart

C program to swap values of two variables

#include<stdio.h>
int main()
{
    int a,b,tmp;
    printf("Enter a b : ");
    scanf("%d%d",&a,&b);
    tmp = a;
    a = b;
    b = tmp;
    printf("a = %d b = %d",a,b);
    return 0;
}

C++ program to swap values of two variables

#include<iostream>
using namespace std;
int main()
{
    int a,b,tmp;
    cout<<"Enter a b : ";
    cin>>a>>b;
    tmp = a;
    a = b;
    b = tmp;
    cout<<"a = "<<a<<" b = "<<b;
    return 0;
}

Output of C C++ program to swap values of two variables

Enter a b : 1 2
a = 2 b = 1
Enter a b : 33 54
a = 54 b = 33

Some important C C++ programs of Sequential logic

  1. Sum of two entered numbers
  2. Average of three entered numbers
  3. Simple interest
  4. Total and Percent
  5. Swapping without using third variable
  6. Celsius to Fahrenheit conversion
  7. Find area and circumference of circle
Share it to:

Write a C C++ program to find total and percent

Write a C C++ program to find total and percent

C Language में Character set क्या होता है जानने के लिए देखें—Character set of C

C Language में Token क्या होता है जानने के लिए देखें—Tokens in C

Flowchart to find total and percent

Find total and percent flowchart

C program to find total and percent

#include<stdio.h>
int main()
{
    int s1,s2,s3,s4,s5,t;
    float p;
    printf("Enter marks of five subjects: ");
    scanf("%d%d%d%d%d",&s1,&s2,&s3,&s4,&s5);
    t=s1+s2+s3+s4+s5;
    p=t/5.0;
    printf("Total = %d Percent = %f",t,p);
    return 0;
}

C++ program to find total and percent

#include<iostream>
using namespace std;
int main()
{
    int s1,s2,s3,s4,s5,t;
    float p;
    cout<<"Enter marks of five subjects: ";
    cin>>s1>>s2>>s3>>s4>>s5;
    t=s1+s2+s3+s4+s5;
    p=t/5.0;
    cout<<"Total = "<<t<<" Percent = "<<p;
    return 0;
}

Output of C C++ program to find total and percent

Enter marks of five subjects: 40 60 50 90 71
Total = 311 Percent = 62.2
Enter marks of five subjects: 78 45 81 90 66 
Total = 311 Percent = 72.000000

List of similar C and C++ programs

  1. Sum of two entered numbers
  2. Average of three entered numbers
  3. Simple interest
  4. Swapping values of two variables
  5. Swapping without using third variable
  6. Celsius to Fahrenheit conversion
  7. Find area and circumference of circle
Share it to:

Write a C C++ program to find simple interest

Write a C C++ program to find simple interest

Object Oriented Programming (OOP) की विभिन्न अवधारणाओं को जानने के लिए देखें—Concepts of OOP

C Language की विशेषताओं एवं शक्तियों को जानने के लिए देखें—Features and Powers of C

Flowchart to find simple interest

Flowchart to find Simple interest

C program to find simple interest

#include<stdio.h>
int main()
{
    int p;
    float r,t,si;
    printf("Enter principle: ");
    scanf("%d",&p);
    printf("Enter rate: ");
    scanf("%f",&r);
    printf("Enter time: ");
    scanf("%f",&t);
    si=p*r*t/100;
    printf("Simple interest = %f",si);
    return 0;
}

C++ program to find simple interest

#include<iostream>
using namespace std;
int main()
{
    int p;
    float r,t,si;
    cout<<"Enter principle: ";
    cin>>p;
    cout<<"Enter rate: ";
    cin>>r;
    cout<<"Enter time: ";
    cin>>t;
    si=p*r*t/100;
    cout<<"Simple interest = "<<si;
    return 0;
}

Output of C C++ program to find simple interest

Enter principle: 1000
Enter rate: 5
Enter time: 2
Simple interest = 100.000000
Enter principle: 60544
Enter rate: 3.2
Enter time: 2.5
Simple interest = 4843.520000

Some other C and C++ important programs

  1. Sum of two entered numbers
  2. Average of three entered numbers
  3. Total and Percent
  4. Swapping values of two variables
  5. Swapping without using third variable
  6. Celsius to Fahrenheit conversion
  7. Find area and circumference of circle
Share it to:

Write a C C++ program to find average of three numbers

Write a C C++ program to find average of three numbers

Procedure Oriented Programming (POP) और Object Oriented Programming (OOP) में अंतर जानने के लिए देखें—POP vs OOP

C और C++ दोनों भाषाओं में महत्वपूर्ण अंतर क्या है जानने के लिए देखें—C vs C++

Flowchart to find average of three numbers

Average of three numbers flowchart

C program to find average of three numbers

#include<stdio.h>
int main()
{
    int n1,n2,n3;
    float avg;
    printf("Enter number1: ");
    scanf("%d",&n1);
    printf("Enter number2: ");
    scanf("%d",&n2);
    printf("Enter number3: ");
    scanf("%d",&n3);
    avg=(n1+n2+n3)/3.0;
    printf("Average of numbers = %f",avg);
    return 0;
}

C++ program to find average of three numbers

#include<iostream>
using namespace std;
int main()
{
    int n1,n2,n3;
    float avg;
    cout<<"Enter number1: ";
    cin>>n1;
    cout<<"Enter number2: ";
    cin>>n2;
    cout<<"Enter number3: ";
    cin>>n3;
    avg=(n1+n2+n3)/3.0;
    cout<<"Average of numbers = "<<avg;
    return 0;
}

Output of C C++ program to find average of three numbers

Enter number1: 30
Enter number2: 90
Enter number3: 60
Average of numbers = 60.000000
Enter number1: 3
Enter number2: 4
Enter number3: 7
Average of numbers = 4.66667

Some other related programs in C C++

  1. Sum of two entered numbers
  2. Simple interest
  3. Total and Percent
  4. Swapping values of two variables
  5. Swapping without using third variable
  6. Celsius to Fahrenheit conversion
  7. Find area and circumference of circle
Share it to:

Write a C C++ program to find sum of two entered numbers

Write a C C++ program to find sum of two entered numbers

C Language के बारे में अधिक जानने के लिए देखें—Brief Introduction of C

C++ Language के बारे में अधिक जानने के लिए देखें—Brief Introduction of C++

Flowchart to find sum of two numbers

Sum of two entered numbers flowchart

C program to find sum of two numbers

#include <stdio.h>
int main()
{
    int n1,n2,sum;
    printf("Enter number1: ");
    scanf("%d",&n1);
    printf("Enter number2: ");
    scanf("%d",&n2);
    sum=n1+n2;
    printf("Sum of numbers = %d",sum);
    return 0;
}

C++ program to find sum of two numbers

#include<iostream>
using namespace std;
int main()
{
    int n1,n2,sum;
    cout<<"Enter number1: ";
    cin>>n1;
    cout<<"Enter number2: ";
    cin>>n2;
    sum=n1+n2;
    cout<<"Sum of numbers = "<<sum;
    return 0;
}

Output of C C++ program to find sum of two numbers

Enter number1: 3
Enter number2: 4
Sum of numbers = 7
Enter number1: 50
Enter number2: 90
Sum of numbers = 140

Other sequential logic programs in C C++

  1. Average of three entered numbers
  2. Simple interest
  3. Total and Percent
  4. Swapping values of two variables
  5. Swapping without using third variable
  6. Celsius to Fahrenheit conversion
  7. Find area and circumference of circle
Share it to: