Chapter 1-p - Program main( ) { /*printing begins*/...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Program main( ) { /*printing begins*/ printf(I see, I remember); /*printing ends*/ } Fig 1.2 A program to print one line of text Addition of Two Numbers Program /* Programm ADDITION line-1 */ /* Written by EBG line-2 */ main() /* line-3 */ { /* line-4 */ int number; /* line-5 */ float amount; /* line-6 */ /* line-7 */ number = 100; /* line-8 */ /* line-9 */ amount = 30.75 + 75.35; /* line-10 */ printf(%d\n,number); /* line-11 */ printf(%5.2f,amount); /* line-12 */ } /* line-13 */ Fig.1.4 Program to add two numbers Program /*--------------------- INVESTMENT PROBLEM --------------------*/ #define PERIOD 10 #define PRINCIPAL 5000.00 /*-------------------- MAIN PROGRAM BEGINS --------------------*/ main() { /*------------------- DECLARATION STATEMENTS ----------------*/ int year; float amount, value, inrate; /*------------------- ASSIGNMENT STATEMENTS -------------------*/ amount = PRINCIPAL; inrate = 0.11; year = 0; /*------------------ COMPUTATION STATEMENTS -------------------*/...
View Full Document

This note was uploaded on 05/14/2010 for the course CS SS ZG653 taught by Professor Shanta during the Spring '09 term at Birla Institute of Technology & Science.

Page1 / 3

Chapter 1-p - Program main( ) { /*printing begins*/...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online