Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Arithmetic Problems-Computer Fundamentals-Lab Codes, Exercises of Computer Fundamentals

The course covers important and advance elements of C and C plus plus programming language. This course provides the student with the skills required to design, code, and test and execute programs of simple to intermediate complexity. It includes: Program, Library, Information, Commands, Declaration, Variables, Integer, Swapping, Inputs, Printf, Displayed

Typology: Exercises

2011/2012

Uploaded on 07/31/2012

karthik
karthik 🇮🇳

4.6

(17)

100 documents

1 / 1

Toggle sidebar

Related documents


Partial preview of the text

Download Arithmetic Problems-Computer Fundamentals-Lab Codes and more Exercises Computer Fundamentals in PDF only on Docsity! /*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*/ } docsity.com
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved