World Top Softwares
Login Please

Join the forum, it's quick and easy

World Top Softwares
Login Please
World Top Softwares
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Search
 
 

Display results as :
 


Rechercher Advanced Search

Log in

I forgot my password

Latest topics
» Practically as cut-price as files
2nd Program EmptyMon Aug 01, 2011 11:44 pm by Guest

» Netbook Brands
2nd Program EmptyMon Aug 01, 2011 5:39 am by Guest

» backlinks checker backlink service
2nd Program EmptySun Jul 31, 2011 8:56 am by Guest

» how to buy facebook fans f4
2nd Program EmptySat Jul 30, 2011 2:34 pm by Guest

» Alle bijzondere dingen in de zaanstreek
2nd Program EmptySat Jul 30, 2011 8:11 am by Guest

» HERE YOU CAN POST ALL WEBSITE LINKS...
2nd Program EmptyWed Aug 26, 2009 2:16 pm by onesimpletech

» cool web site for all must check it
2nd Program EmptyMon Jul 06, 2009 2:32 pm by Snopy Cobra

» poetry spirit
2nd Program EmptyMon Jul 06, 2009 2:31 pm by Snopy Cobra

» best to learn VC++
2nd Program EmptySun May 10, 2009 3:22 pm by Guest

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search
Statistics
We have 30 registered users
The newest registered user is deigavr

Our users have posted a total of 191 messages in 126 subjects
Who is online?
In total there are 2 users online :: 0 Registered, 0 Hidden and 2 Guests

None

[ View the whole list ]


Most users ever online was 125 on Wed Apr 07, 2021 9:18 am
RSS feeds


Yahoo! 
MSN 
AOL 
Netvibes 
Bloglines 



2nd Program

Go down

2nd Program Empty 2nd Program

Post by Snopy Cobra Sun Jan 04, 2009 7:20 pm

Objective

To understand the Data Types used.

Theory


Classification of a particular type of information is easy for humans to distinguish between different types of data. We can usually tell at a glance whether a number is a percentage, a time, or an amount of money, that indicate the data's type. Similarly, a computer uses special internal codes to keep track of the different types of data it processes.

Most programming languages require the programmer to declare the data type of every data object, and most database systems require the user to specify the type of each data field. The available data types vary from one programming language to another, and from one database application to another, but the following usually exist in one form or another:

• integer : In more common parlance, whole number; a number that has no fractional part.
• floating-point : A number with a decimal point. For example, 3 is an integer, but 3.5 is a floating-point number.
• character (text ): Readable text

Integer

Integer is a fundamental data type used to define numeric variables holding whole numbers. The integers are the set of numbers consisting of the natural numbers including 0 (0, 1, 2, 3, ...) and their negatives (0, −1, −2, −3, ...). They are numbers that can be written without a fractional or decimal component.









Character

A Character is any symbol that requires one byte of storage. This includes all the ASCII and extended ASCII characters, including the space character. In character-based software, everything that appears on the screen, including graphics symbols, is considered to be a character. In graphics-based applications, the term character is generally reserved for letters, numbers, and punctuation.


Floating-point number
The term floating point is derived from the fact that there is no fixed number of digits before and after the decimal point; that is, the decimal point can float. There are also representations in which the number of digits before and after the decimal point is set, called fixed-point representations. In general, floating-point representations are slower and less accurate than fixed-point representations, but they can handle a larger range of numbers.


Task:
1.Calculate the Gross Pay of a person having Allowance is 15% and House Rent is 10% of the Salary.
Coding
#include<stdio.h>
void main(void)
{
float a,h,g,s;

printf("ENTER SALARY");
scanf("%f",&s);
a=15*s/100;
h=10*s/100;
g=a+h+s;
printf("GROSS AMOUNT IS %f",g);
}


2.Find the Area and Perimeter of a Rectangle, taking Length and Breadth as input and calculate
Area = L * B and Perimeter = 2 * (L + B)
coding
#include<stdio.h>
void main(void)
{
int l,b,area,peri;
printf("ENTER LENGTH");
scanf("%d",&l);
printf("ENTER BREADTH");
scanf("%d",&b);
area=l*b;
peri=2*(l+b);
printf("Area=%d\nPerimeter=%d\n",area,peri);
}

(Created By Ayaz)
Snopy Cobra
Snopy Cobra
Admin
Admin

Number of posts : 99
Age : 33
Location : Bahria University Karachi
Reputation : 0
Registration date : 2008-07-31

https://telecompk.forumotion.com

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum