Preview

Computer

Good Essays
Open Document
Open Document
6438 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Computer
C and Data Structures Lab Manual

Lab Manual
Computer Engineering and Information Technology III Semester / ‘K’ Scheme
Prepared By K.ManiRaj M.Sc.,M.Phil., & P.Vinitha M.Sc M.Phil Lecturer, Department of CE/IT, M.S.P.V.L Polytechnic College, Pavoorchatram.
M.S.P.V.L Polytechnic College, Pavoorchatram Page 1

C and Data Structures Lab Manual

1A Celsius to Fahrenheit Conversion and vice versa
Aim:
To write a ‘C’ program to convert the given temperature in degree centigrade to Fahrenheit and vice versa.

Flow chart:

Start

Read C

F=9.0/5.0*c+32

Print F

Read F

C=5.0/9.0*(F-32)

Print C

Stop

M.S.P.V.L Polytechnic College, Pavoorchatram

Page 2

C and Data Structures Lab Manual

Algorithm:
1. Read the temperature in degree Centigrade. 2. Convert the Centigrade to Fahrenheit using the formula F=9/5*c+32 3. Print the Celsius and Fahrenheit value. 4. Read the temperature in degree Fahrenheit. 5. Convert the Fahrenheit to Centigrade using the formula C=5/9*(F-32) 6. Print the Fahrenheit and Celsius value. 7. Stop

Program:
/* Program to convert Centigrade to Fahrenheit and vice versa */ #include #include void main() { float c,f; clrscr(); /*To convert Centigrade to Fahrenheit*/ printf("Enter the temperature in centigrade:"); scanf("%f",&c); f=9.0/5.0*c+32; printf("\n\t%.2f Centigrade=%.2f Fahrenheit",c,f); /*To convert Fahrenheit to centigrade*/ printf("\n\nEnter the temperature in Fahrenheit:"); scanf("%f",&f); c=5.0/9.0*(f-32); printf("\n\t%.2f Fahrenheit=%.2f Centigrade",f,c); getch(); }

Output:
Enter the temperature in centigrade:45 45.00 Centigrade=113.00 Fahrenheit Enter the temperature in Fahrenheit:114

M.S.P.V.L Polytechnic College, Pavoorchatram

Page 3

C and Data Structures Lab Manual

114.00 Fahrenheit=45.56 Centigrade

1B
Aim:

Simple Interest and Compound Interest Calculation

To write a ‘C’ program to find the simple interest and Compound interest for the Amount

You May Also Find These Documents Helpful

  • Good Essays

    Molar Mass of Butane

    • 789 Words
    • 4 Pages

    Celsius to Kelvin temperature conversion: 17.7° C + 273 = 290.7 Kelvin (rounded to SF= 291 K)…

    • 789 Words
    • 4 Pages
    Good Essays
  • Good Essays

    PHYS172 Lab14

    • 2023 Words
    • 10 Pages

    using the program you developed in the previous lab to find the temperature of a block.…

    • 2023 Words
    • 10 Pages
    Good Essays
  • Satisfactory Essays

    Pt1420 Unit 7 Study Guide

    • 582 Words
    • 3 Pages

    17.Write a program to read a binary input from the keyboard and display it. Page: 130…

    • 582 Words
    • 3 Pages
    Satisfactory Essays
  • Good Essays

    Temperature Measurements: Look closely at the thermometer and record to the best number of significant figures, +/- 0.1 oC. In other words report, for example 24.0 oC, not 24 oC. Calculate the last 2 columns. (1 point)…

    • 1509 Words
    • 7 Pages
    Good Essays
  • Good Essays

    Specific Heat Lab

    • 688 Words
    • 3 Pages

    4) Fill the calorimeter with 70.0g of tap water and record its initial temperature (23.0oC)…

    • 688 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    7. In the equation y = 3.8x, if the value of x is increased by 2, what is the effect on the value of y?…

    • 362 Words
    • 5 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Z Lunch Experiment Essay

    • 414 Words
    • 2 Pages

    In Preston High School, the students have the privilege of eating lunch outside and on the patio. However, the number of students that sit outside varies due to the conditions outside the school building, such as the weather. The weather can range from cold, 50°F to 60° F which is below an average person’s body temperature, and to hot, 90° F and above which is above an average person’s body temperature. The “perfect” temperature is considered 65°F to 85°F because it is the closest to an average person’s body temperature. In Preston, about 165 students have Z lunch on A-type days and 172 students have Z lunch on B-type days. Every day, from October 16th to November 3rd, the number of students who eat outside during Z lunch and the temperature during that period will be documented. It will be compared to how many have lunch that day to reveal how many students had lunch outside. According to this information, it is predicted that more students will sit outside during Z lunch when the temperature is around 65°F to 85°F rather than 50°F to 60°F or 90°F and above.…

    • 414 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Labs combined

    • 2238 Words
    • 24 Pages

    A.At absolute zero, there would be slow motion of the molecules and the temperature would be -273 F.…

    • 2238 Words
    • 24 Pages
    Satisfactory Essays
  • Good Essays

    3. Use a thermometer to measure the temperature of the water in the beaker using Celsius units. Record the measurements in Data Table 2.…

    • 2302 Words
    • 10 Pages
    Good Essays
  • Good Essays

    The purpose of this experiment is to determine mass, length, temperature, volume, and density of objects and liquids using common measuring devices and algebraic formulas. The metric system, the most common set of measurements used in science, which includes meters, liters, Celsius, and grams will be used.…

    • 2216 Words
    • 9 Pages
    Good Essays
  • Satisfactory Essays

    2. You are given a clear solution of KNO3. Using 3 – 4 sentences (in your own words) explain how you would determine if the solution is unsaturated, saturated or supersaturated.…

    • 624 Words
    • 3 Pages
    Satisfactory Essays
  • Good Essays

    All units logically fit next to each other in it. While the Imperial System however, uses a confusing system that nothing is similar in. Twelve inches to a foot and three feet to a yard are not a simple as Metric units. The Metric System has everything fit into each other by units of ten. Which is ten millimeters fits into a single centimeter. 1000 meters can fit into a kilometer, and ten of those go into a megameter. The temperature scale in the Metric System, Celsius, is a simple line from zero degrees to one-hundred degrees, zero being the freezing point of water and one-hundred being the boiling point of water. The Fahrenheit scale, the Imperial Systems’s temperature scale, has the freezing point of water at thirty-two degrees and the boiling point is at two-hundred and twelve degrees. The Imperial system’s temperature system is one of the many things that are less organized and does not make a lot of sense. Many Americans don’t understand their own system completely as in they don’t know how many fluid ounces are in a…

    • 705 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    1. Temperature: Put some hot water, warm water, and cold water in three bowls. Just use water from your faucet, and please be sure that the hot water is not too hot to touch! Place a finger in the hot water and a finger of the other hand in the cold water. After a few seconds, place them both in the warm water. Describe the sensations. Can you trust your senses for measuring temperature? Explain your answer.…

    • 484 Words
    • 3 Pages
    Satisfactory Essays
  • Good Essays

    Intermolecular Forces

    • 971 Words
    • 4 Pages

    Experiment 9 is conducted to identify the importance of intermolecular forces and how they affect molecules. Intermolecular forces are forces between molecules that determine whether the molecule is a solid, liquid, or gas under standard conditions. In our lab, we measured the maximum and minimum temperature reached and time it took to reach it of alcohols and alkanes. In addition, we measured the vapor pressure of the liquid at different temperatures. Through Experiment 9, we concluded that molecules with hydrogen bonds or long chains in the structural formula have stronger intermolecular forces, and that as temperature increases the vapor pressure of a substance increases exponentially.…

    • 971 Words
    • 4 Pages
    Good Essays
  • Good Essays

    Planning a Lesson

    • 340 Words
    • 2 Pages

    You are a science teacher planning a lesson on monitoring changes in temperature. Given lab equipment, a thermometer and three cups of water at different temperatures, students will be able to record the temperatures on a graph with 80% accuracy.…

    • 340 Words
    • 2 Pages
    Good Essays