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
3rd program EmptyMon Aug 01, 2011 11:44 pm by Guest

» Netbook Brands
3rd program EmptyMon Aug 01, 2011 5:39 am by Guest

» backlinks checker backlink service
3rd program EmptySun Jul 31, 2011 8:56 am by Guest

» how to buy facebook fans f4
3rd program EmptySat Jul 30, 2011 2:34 pm by Guest

» Alle bijzondere dingen in de zaanstreek
3rd program EmptySat Jul 30, 2011 8:11 am by Guest

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

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

» poetry spirit
3rd program EmptyMon Jul 06, 2009 2:31 pm by Snopy Cobra

» best to learn VC++
3rd 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 



3rd program

Go down

3rd program Empty 3rd program

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

Theory

“A variable is a space in the computer’s memory set aside for a certain kind of data and given a name for easy reference.”

Variables may be the most fundamentals aspect of any computer language. Variables are used so that the same space in memory can hold different values at different times. For instance, suppose you are writing a program to calculate someone’s paycheck, you will need to store at least the hourly rate and the hours worked. If you want to do the calculation for more than one employee, you will need to use the same program and the same spaces in memory to store similar data for additional employees. A variable is a space in memory that plays the same role many times, but may contain a different value each time.


Task:
1. Write a program that takes your age as input and calculate the total number of hours old?
#include<stdio.h>
void main(void)
{
int a,h;
printf("ENTER YOUR AGE ");
scanf("%d",&a);
h=8760*a;
printf("YOU ARE %d HOURS OLD\n",h);
}
2. Write a program that takes two integers as input, perform the following and print the result.
a + b , a – b , a * b , a / b

#include<stdio.h>
void main(void)
{
int p,o,i,t,u,j;
printf("ENTER 1st Integer\n");
scanf("%d",&i);
printf("ENTER 2nd Integer\n");
scanf("%d",&j);
p=i+j;
o=i-j;
t=i*j;
u=i/j;
printf("1st %d\n",p);
printf("2nd %d\n",o);
printf("3rd %d\n",t);
printf("4th %d\n",u);
}
Snopy Cobra
Snopy Cobra
Admin
Admin

Number of posts : 99
Age : 34
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