Skip to content

ashikurrahmans/c-programing-concept

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 

Repository files navigation

Problem solving through c language

Table of contents

No Questions
Input & Output System
1 Make Lower case to Capital
2 Make Capital case to Lower
3 Convert Decimal to Hexa Decimal
4 Sum 2 numbers from inputs
5 Average number from inputs
6 Area of a triangle by height & weight
7 Length of 3 sides of triangle
8 Area of rectangle
9 Radius of the circle
10 Fahrenheit to Celsius
11 Celsius to Fahrenheit
  1. Make lower case to capital

    char makeCapital;
    
    printf("Write a lower case character : ");
    scanf("%c",&makeCapital);
    
    printf("Your conversion is : %c",makeCapital - 32;
  1. Make Capital case to Lower

    char makeLower;
    
    printf("Write a Capital character : ");
    scanf("%c",&makeLower);
    
    printf("Your conversion is : %c",makeLower + 32);
  1. Decimal to Hexa Decimal

    int number;
    printf("Write an integer number : ");
    scanf("%d",&number);

    printf("Hexadecimal Number : %x",number);
  1. Sum 2 Numbers from inputs

    in this section i am going to take 2 different numbers for make addition ans show the result in console.

    int num1,num2,sum;
    
    printf("Write two numbers : ");
    scanf("%d %d",&num1,&num2);

    sum = num1 + num2;
    printf("Two number sum is : %d",sum);

  1. Average Number from inputs

    int num1,num2,result;
    float evg;
    
    printf("Write two numbers :");
    scanf("%d %d",&num1,&num2);

    result = num1 + num2 ;
    printf("Sum is : %d", result);

    evg = (float)result / 2 ;
    printf("average is : %.1f",evg);
  1. Area Of A Triangle from inputs

    float height , base , area;
    
    printf("What is your height : ");
    scanf("%f",&height);
    
    printf("What is your width : ");
    scanf("%f",&base);
    
    area = (float)1/2 * height * base;
    printf("Result is : %.2f",area);
  1. Length of 3 sides of a triangle

    double a , b , c, s , area;
    
    printf("Enter 3 Values : ");
    scanf("%lf %lf %lf",&a,&b,&c);

    s = (a+b+c)/2;
    area = sqrt(s*(s-a)*(s-b)*(s-c));

    printf("The Area of Triangle : %.2lf",area);
  1. Area of Rectangle

    float length,width,area;

    printf("Enter your length : ");
    scanf("%f",&length);

    printf("Enter your width : ");
    scanf("%f",&width);

    area = length * width;

    printf("The area of rectangle : %.2f",area);
    
  1. Radius of the circle

    float area , radius;
    printf("Write your radius : ");
    scanf("%f",&radius);

    area = 3.1416 * radius * radius;

    printf("Area of Circle : %.2f",area);
  1. Fahrenheit to Celsius


float c , f ;
printf("Write your centegrate value : ");
scanf("%f",&c);

f = (1.8 * c)+ 32;

printf("Fahrenheit : %.2f \n",f);

  1. Celsius to Fahrenheit

// Rules : c = (f-32)/1.8;

float c , f;

printf("Write your fahrenheit value : "); scanf("%f",&f);

c = (f-32)/1.8;

printf("Celcius value is : %.2f",c);

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published