Posts

Showing posts with the label getting started

Chapter 1 : Introduction

Image
# Let us C Chapter 1 : Introduction Let us C (by Yashavant Kanetkar) There are four important aspects of any language. They are 1) The way it stores data 2) The way it operates upon this data 3) How it accomplishes input and output 4) How it lets you control the sequence of execution of instructions in a program. This chapter explains first three of them. C is different from C++, C# and JAVA in following aspects. 1) C++, C# or Java make use of Object Oriented Programming (OOP). 2) Major parts of popular operating systems like Windows, UNIX, Linux is still written in C. 3) Device driver programs are exclusively written in C. 4) Speed is where C language scores over other languages. C Learning Steps The C Character Set Types of C Constants C constants can be divided into two major categories: (a) Primary Constants (b) Secondary Constants Types of C Constants Rules for Constructing Integer Constants (a) An integer constant must have at least one digit. (b) It must not have a decimal p...

Chapter 1 : Getting Started (Let us C)

(a) Ramesh's basic salary is input through the keyboard. His dearness allowance is 40% of basic salary, and house rent allowance is 20% of basic salary. Write a program to calculate his gross salary. // Let Us C Chapter-1:Program-1 /*(a) Ramesh's basic salary is input through the keyboard. His dearness allowance is 40% of basic salary, and house rent allowance is 20% of basic salary. Write a program to calculate his gross salary.*/ #include<stdio.h> float BASIC,DA,HRA,GS; void main() { clrscr(); printf("Enter BASIC salary: "); scanf("%f",&BASIC); DA = BASIC*0.4; HRA = BASIC*0.2; GS = BASIC + DA + HRA; printf("\nGross Salary = %f",GS); } (b) The distance between two cities (in km.) is input through the keyboard. Write a program to convert and print this distance in meters, feet, inches and centimeters. // Let Us C Chapter-1:Program-2 /* The distance between two cities (in km.) is input through the key...