Computer Science, asked by ridaaslam9722, 1 year ago

1. what is program to swap the value of 2 number ? (in 50 words )

2. What are the various features of programming language?(in 150 words )

Answers

Answered by softwarecrackerindia
0

#include <stdio.h>

int main()

{

double firstNumber, secondNumber, temporaryVariable;

printf("Enter first number: ");

scanf("%lf", &firstNumber);

printf("Enter second number: ");

scanf("%lf",&secondNumber);

// Value of firstNumber is assigned to temporaryVariable

temporaryVariable = firstNumber;

// Value of secondNumber is assigned to firstNumber

firstNumber = secondNumber;

// Value of temporaryVariable (which contains the initial value of firstNumber) is assigned to secondNumber

secondNumber = temporaryVariable;

printf("\nAfter swapping, firstNumber = %.2lf\n", firstNumber);

printf("After swapping, secondNumber = %.2lf", secondNumber);

return 0;

}

output

Enter first number: 1.20

Enter second number: 2.45

After swapping, firstNumber = 2.45

After swapping, secondNumber = 1.20

no 2 A programming language is an artificial language used to create programs that express precise algorithms to make a computer perform computations.

Programming languages allow the manipulation of data structures and the flow of execution of a program.

There are several different kinds of programming languages, which differ in many aspects, the most important of them being the computations they are capable of, also known as the expressive power of a programming language.

Each programming language provides a basic set of elements, which describes data and the processes and transformations which can be applied to them, also called primitives of that language.

A very important element of programming languages is their syntax. Most programming languages are textual and their syntax includes words, numbers, and punctuations. However, there are other programming languages that make use of a graphical approach, where programs are created by a visual representation of symbols, for example, a flowchart.

The syntax of a program defines the possible combinations of symbols that constitute a syntactically...

Similar questions