http://youtu.be/Yn1a2fcuB9s (how to use Camstadio)
How to process flowchart with c program
This time I will post about my exercises of course TMD02 from this exercise i must create a simple application using C programming with using Visual Studio 2012.
Actually, there is application that I created by myself that using C programming.
Moreover, in this exercise we must create just simple application that include variable, operator and control flow.
As a result, it is the time I create currency converter program.
The picture below is the how to process of flowchart for calculation triangle pyramid ball and sphere:

Code :
#include
#include
int main(void)
{
int a;
float b,h1,h2,v,pi= 3.14159,r;
do{
printf("Please input value =");
scanf_s("%d",&a);
switch (a){
case 1:
printf("Calclator the valume of triangle pyramid ball : \n");
printf("please input value of base bottom = ");
scanf_s ("%f",&b);
printf("please input value of base height =");
scanf_s ("%f",&h1);
printf("please input value of base pyramid height =");
scanf_s ("%f",&h2);
v = (((b*h1)/2)*h2/3);
printf ("The value of triangle pyramid ball is = %f \n ",v);
break;
case 2:
printf(" calculte valume of sphere ");
printf("Please input value of radius = \n");
scanf_s("%f",&r);
v = ((pi*r*r*r)*4)/3;
printf("value of sphere is =%f \n",v);
break;
default:
printf("You do not type number 1 or 2 please input your value again");
break;
}
}while ((a != 1)&&(a != 2));
system("pause");
return 0;
}
No comments:
Post a Comment