Tuesday, October 23, 2012

Competency Progress: Hello TMD and calculate area of tripezium

Dear Dr.
Name: Sean Vandet
Major: Modul1
 

 + print Hello TMD

#include<stdio.h>    //library of input and output standard
#include<stdlib.h>    //library of system("pause")

int main(void)    //method main() for compile the program
{   
    printf("Hello TMD!.\n"); //output on screen

    system("pause"); //pause the system
    return 0;    //return value to user
}


link to youtube:
http://www.youtube.com/watch?v=JbZM64dnrkk&feature=youtu.be



+ Calculate area tripezium

#include<stdio.h>     //library of input and output standard
#include<stdlib.h>    //library of system("pause")

int main(void)           //main() method for compile the program
{
    float a, b, h, areaTripezium;             //declare variable (float)
    printf("Please enter the number: \n"); //show output on screen
    printf("a is: ");
    scanf("%f",&a);     //input the data from keyboard

    printf("b is: ");
    scanf("%f",&b);

    printf("h is: ");
    scanf("%f",&h);

    areaTripezium = h * (a + b) /2;          //calculate area of Tripezium
    printf("Area of Tripezium is: %f\n", areaTripezium);

    system("pause");   //pause the system
    return 0;               //return value to the user (false)
}


link to youtube:
http://www.youtube.com/watch?v=JbZM64dnrkk&feature=youtu.be


sorry Dr. that i sand you late because my internet so slow show i attach file it so long time

No comments:

Post a Comment