
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

/In the very first step of program,the library will be included which will contain necessary information of commands i used in the program./
#include<stdio.h>
/second step is the declaration ,that main function of the program is integeer type function/
int main()
/the program is written in the middle brackets{}/
{
/it is the declaration that variables a and b are integer type/
float a,b;
/topic of program/
printf("SWAPPING OF GIVEN INPUTS\n\n\n");
/by this printf command user will be able to know that he has to enter input here/
printf ("please input a and b\na="); scanf("%f",&a); printf("b="); scanf("%f",&b);
/following three steps will swap the values of a and b/
a=a-b; b=b+a; a=b-a;
/here the output of the program will be displayed/
printf("the values of a and b are swapped as follows\na=%.3f\nb=%.3f\n",a,b); return 0;
/following bracket indicates the termination of program and it makes the pair with the first bracket we used in our program/
}