Feb 17, 2022

Example through learning datatypes and mathematical operations ( C language)

Mathematical operations using float and integers.

 #include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>

int main()
{
    int a, b;
    float c, d;
    scanf("%d",&a);
    scanf("%d",&b);
    printf("\n");
    scanf("%f",&c);
    scanf("%f",&d);

    printf("%d %d\n", a + b, a - b);
    printf("%.1f %.1f", c + d, c - d);


    return 0;
}

No comments:

Post a Comment

Comparing two files in C language.

Operations on More than one File.    # include < stdio.h > # include < stdlib.h > # include < string.h > int main ( int ...