Computer Science, asked by musaddi619, 4 months ago

2. Think and write different components of a program. Define any one of them.​

Answers

Answered by Anonymous
4

Explanation:

There are five basic programming elements, or operations: input, output, arithmetic, conditional, and looping. Every program uses at least two of these. This lesson will describe each one to you and show you examples in simple code.

Answered by RehanAk73
1

Answer:

There are five basic programming elements, or operations: input, output, arithmetic, conditional, and looping. Every program uses at least two of these. This lesson will describe each one to you and show you examples in simple code.

Explanation:

C Arithmetic operators are used to perform mathematical calculations like addition, subtraction, multiplication, division and modulus in C programs.

Arithmetic Operators/Operation                      Example

+ (Addition)                                                             A+B

– (Subtraction)                                                        A-B

* (multiplication)                                                      A*B

/ (Division)                                                               A/B

% (Modulus)                                                            A%B

#include <stdio.h>

 

int main()

{

  int a=40,b=20, add,sub,mul,div,mod;

  add = a+b;

  sub = a-b;

  mul = a*b;

  div = a/b;

  mod = a%b;

  printf("Addition of a, b is : %d\n", add);

  printf("Subtraction of a, b is : %d\n", sub);

  printf("Multiplication of a, b is : %d\n", mul);

  printf("Division of a, b is : %d\n", div);

  printf("Modulus of a, b is : %d\n", mod);

Similar questions