Pages

Wednesday, October 20, 2010

C PROGAMMING

#include<stdio.h>
#include<conio.h>

void main()
{
    int PP,TPriceB;

    clrscr();
    printf("\n\tEnter the number of pingpong balls was purchased:^");
    scanf("%d",&PP);

    if(PP>=5)
    {
        TPriceB =PP*18;
        printf("\n\tOne ball costs P 18.");
    }
    else
    {
        TPriceB =PP*20;
        printf("\n\tOne ball costs P 20.");
    }
    printf("\n\n\tThe total price of the pingpong balls purchased: P %d",TPriceB);
    getch();
}


FOR MORE INFORMATION 

No comments:

Post a Comment