Advantage and Disadvantage of Mobile Phone

Topics: ASCII, Unicode, Long integer Pages: 4 (520 words) Published: August 28, 2013
Example 2.1: Program calculate the sum of two numbers

/* Program that calculate the sum of two numbers. */
#include
#include
int a,b,c;

int sum(int x, int y);

int main()
{
/* Input the first number */
printf("Enter a first number: ");
scanf("%d", &a);

/* Input the second number */
printf("Enter a second number: ");
scanf("%d", &b);

c = sum(a, b);
printf ("%d Add %d = %d\n", a, b, c);
getch();
return 0;
}

int sum(int x, int y)
{
return (x + y);
}

Data Type used in C Program

|Variable Type |Keyword |Number of Bytes |Rage of values | | |(Typename) | | | |Character | char |1 |0 to 255 | |Integer | int |2 |-32768 to +32767 | |Long integer | long |4 |-2,147,483,648 to +2,147,438,647 | |Unsigned integer | unsigned int |2 |0 to 65535 | |Unsigned long integer | unsigned long |4 |0 to 4,294,967,295 | |Single-precision | float |4 |1.2E-38 to +3.4E38 | |Double-precision | double |8 |2.2E-308 to +1.8E308 |

The ASCII Character Code:

The ASCII character code charts contain the decimal and hexadecimal values of the extended ASCII...
Continue Reading

Please join StudyMode to read the full document

You May Also Find These Documents Helpful

  • Advantages and Disadvantages of Mobile Phones Essay
  • Essay on Advantages & Disadvantages of Mobile Phone
  • Essay about Advantage and Disadvantage of Mobile Phone
  • Advantages & Disadvantages of Mobile Phone Essay
  • disadvantages of mobile phones Essay
  • The Advantages and Disadvantages of Mobile Phone Technology Essay
  • Advantages and Disadvantages of Mobile Phones Essay
  • Advantages and disadvantages of mobile phones Essay

Become a StudyMode Member

Sign Up - It's Free