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



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. comm.jar file for windows not available in sun. ca
View Tutorial          By: borus at 2015-03-25 07:19:57

2. Clear explanation...
View Tutorial          By: Nisha at 2013-01-31 05:10:29

3. What is transient keyword in Java?


View Tutorial          By: Mohit at 2010-11-18 00:26:24

4. Thanks,It worked.I tried with Microsoft Visual C++
View Tutorial          By: gaurav at 2013-12-04 08:27:35

5. this text is overlapping the existing text what if
View Tutorial          By: Alda at 2015-10-02 18:22:22

6. Good programs example need for me
View Tutorial          By: G.Venugopal at 2009-11-11 08:46:38

7. its very easy to understand and implements.
View Tutorial          By: ashish at 2011-05-20 03:12:07

8. Thanks for the tutorial. I want to create a catalo
View Tutorial          By: Lue at 2012-07-09 07:00:08

9. Very new to Java and was hoping you could explain
View Tutorial          By: Confused at 2011-08-16 14:02:06

10. Hey,
The above tutorial is for SQL server,<

View Tutorial          By: Anil at 2012-02-07 15:58:06