Saturday, October 19, 2013

Module IV



The introduction consist with variable, operator, control flow , and function in C program for using Visual Studio 2012
            http://youtu.be/H274cy2Mpjg (video how to create code in C in Visual studio 2012 consist with variable, operator, control flow , and function (mathemathic function))
This is a time for me to introduce about how to right code in C program for Visual Studio 2012 that consist variable, operator, control flow, and function. The function for this introduction, I will chose the Math.h function that all consist with variable , operator, control and function. Moreover, in this code I will include the global declaration variable and some syntax relate with mathematic function.
            Then, in this below, it is a flowchart of how to process of the code in C that consist with variable, operator, control flow, and function relate with math.h function.




















 The last, is the code of the these introduction. Please look the code in below:
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
voidconisius(float m);
void sinus(float m);
voidtangen(float m);
floatm,b,h;
int s;
int main(void)
{
            repeat:
            printf("Knowing the function Math.h in C\n");
            printf("____________________________________\n");
            printf("1. conisiuus\n");
            printf("2. sinus\n");
            printf("3. tangen\n");
            printf("_____________________________________\n");
            printf("Input your selection >> ");
            scanf_s("%i",&s);
            if(s==1)
            {
                        conisius(m);
            }
            else if(s==2)
            {
                        sinus(m);
            }
            else if(s==3)
            {
                        tangen(m);
            }
            else
            {
                        printf("Input selection from 1 to 3\n");
                        goto repeat;
            }
            system("pause");
            return(0);
}
voidconisius(float m)
{
            printf("Your choice function Conisius\n");
            printf("_________________________________\n");
            printf("Input numeral >>");
            scanf_s("%.2f",&m);
            h = cos(m);
            printf("Cos from %f >> %f",h);
}
void sinus(float m)
{
            printf("Your choice function Sinus\n");
            printf("_________________________________\n");
            printf("Input numeral >>");scanf_s("%f",&m);
            h = sin(m);
            printf("Sinus from %f >> %.2f \n",,h);
}
voidtangen(float m)
{
            printf("Your choice function Tangen\n");
            printf("________________________________\n");
            printf("Input numeral >>");scanf_s("%f",&m);
            h = tan(m);
            printf("Pangkat from %f >> %.2f",,h);
}


eeff

No comments:

Post a Comment