Wednesday, 8 December 2021

arithmetical oprators

project:-1 

#include <stdio.h>


int main()
{
     int a, b;
     a= 55;
     b= 5;

     printf ("a+b= %d\n", a+b);
     printf ("a-b= %d\n", a-b);
     printf ("a*b= %d\n", a*b);
     printf ("a/b= %d\n", a/b);
     
     return 0;

}

//operator:- a symbol that performs a specific operation.
// types of operators
// arithmetical oprators :- +,-,*,/,% etc.
// relational oprator
// logical operator
// bitwise operator
// assignment operator

project:-2

#include <stdio.h>
int main()
{
     int a, b, c;
     a= 27;
     b= 9;
     c= 3;
         
         
     printf("A+B+C will be= %d\n", a+b+c);    

     printf("A-B-C will be= %d\n", a-b-c);

     printf("A*B*C will be= %d\n", a*b*c);

     printf("A/B/C will be= %d\n", a/b/c);

     return 0;
 

}

output results:_
A+B+C will be= 39
A-B-C will be= 15
A*B*C will be= 729
A/B/C will be= 1

//project:_6 (arithmetical operators)
#include <stdio.h>
#include <math.h>
int main ()
{
    int a,b,c;

    printf ("enter the first number: ");
    scanf ("%d", &a);

    printf ("enter the second number: ");
    scanf ("%d", &b);

    printf ("enter the third number: ");
    scanf ("%d", &c);

    printf ("the addition will be: %d\n",a+b+c);
    printf ("the subtraction will be: %d\n",a-b-c);
    printf ("the multiplication will be: %d\n",a*b*c);
    printf ("the division will be: %d\n",a/b/c);

    printf ("the square root of %d will be: %f\n",c, sqrt(c));
    printf ("the square of the %d will be: %d\n",a, a*a);

    return 0;
}
output:_
enter the first number: 8 enter the second number: 4 enter the third number: 2 the addition will be: 14 the subtraction will be: 2 the multiplication will be: 64 the division will be: 1 the square root of 2 will be: 1.414214 the square of the 8 will be: 64

No comments:

Post a Comment

here we are to help you.you can watch videos and get information about :- (1) scientific facts (2) education (3) gaming (4) music (5) lyrics (6) cartoons and many more.So keep watching keep learning, thank you.

Recurtions

  //Why are recursions? //We can solve difficult long iteratively can be solved simply recursively. // there are some problems which suite...