Comment on Tutorial - Using switch Statements in C++ By Emiley J



Comment Added by : shah

Comment Added at : 2011-02-07 01:11:12

Comment on Tutorial : Using switch Statements in C++ By Emiley J
I want inserted switch statement in my program,
Really need your help and comment.. Thank you..

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

Main () /*calculate maximun stress */
{

float P, L, w, t;

printf("\t\t\n\n\n <<<This program is to calculate maximum stress>>>\t\n\n\n");
printf("Please input force value, P [KN]: ");
scanf("%f" , &P);
printf("Please input length, L [m]: ");
scanf("%f" , &L);
printf("Please input width, w [cm]: ");
scanf("%f" , &w);
printf("Please input thickness, t [cm]: ");
scanf("%f" , &t);


/* calculate M, y, I */

float M, y, I, max ;

/* convertion */
float w_m, t_m, P_N;
t_m = t /100;
w_m = w /100;
P_N = P * 1000;

/* calculation */

M = P_N * L;
y = t_m /2;
I = (w_m * pow(t_m,3 )) /12 ;
max = (M * y)/ I ;

/* Result */

printf("\n The maximun stress is = %8.3e[pa] or %8.2f[Mpa] \n ", max , max/10000000 );
getch();
system("PAUSE");

}

from..shah


View Tutorial



Subscribe to Tutorials

Related Tutorials

Program using concept of byte long short and int in java

Update contents of a file within a jar file

Tomcat and httpd configured in port 8080 and 80

Java File

Java String

Count number of vowels, consonants and digits in a String in Java

Reverse a number in Java

Student marks calculation program in Java

Handling Fractions in Java

Calculate gross salary in Java

Calculate average sale of the week in Java

Vector in Java - Sample Program

MultiLevel Inheritance sample in Java

Multiple Inheritance sample in Java

Java program using Method Overriding

Archived Comments

1. Really a appriciatable one. Can u plz send the cod
View Tutorial          By: Jeevan at 2009-04-11 12:39:45

2. This is a great article that deals with the evolut
View Tutorial          By: JPS SASTRY at 2009-02-11 21:29:56

3. hai,
i want to know how the connect

View Tutorial          By: V.Selvi at 2010-02-28 21:01:33

4. 3. Write a program that will continuously ask for
View Tutorial          By: basil at 2011-08-04 13:00:30

5. Great explanations! I looked for other guides and
View Tutorial          By: A.Lepe at 2010-09-15 21:36:42

6. i m very glad to know and use this site. this is w
View Tutorial          By: Rupinder at 2009-09-08 08:49:23

7. superb...thanks :-)
View Tutorial          By: sunny at 2010-11-10 07:20:25

8. hey pls tel me, what is the advantage of method ov
View Tutorial          By: divya at 2013-08-27 14:20:22

9. its nice example for beginers
View Tutorial          By: Ramesh at 2012-02-15 18:13:09

10. this total example is copy paste from the Herbert
View Tutorial          By: Parna at 2012-06-03 05:16:37