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. This is a great idea if I am targeting the require
View Tutorial          By: Shanthamurthy Hanumantharayappa at 2015-09-14 16:45:22

2. Thanks!! Its very helpful.
View Tutorial          By: Tawfiiq at 2012-07-06 05:29:50

3. Hello
thanks for nice tutorial. I have one

View Tutorial          By: Chanchal Prajapat at 2015-02-09 06:10:42

4. hai.....people ..............


View Tutorial          By: spartan at 2009-08-08 08:42:35

5. Well, this fix worked form me using Apache 2.2.11,
View Tutorial          By: Bruce at 2009-07-21 15:03:02

6. This site is an Excellent Choice for lerners.Thank
View Tutorial          By: Sravanthi at 2011-06-28 06:20:35

7. How could i read a file from my ftp server . sugge
View Tutorial          By: Dinshaw at 2015-02-06 07:22:03

8. Sorry, I can't understand what is really apply and
View Tutorial          By: Ejita at 2012-02-01 05:38:09

9. Thanks.. worked perfectly :)
View Tutorial          By: DJ at 2012-04-05 19:40:43

10. thanks for providing such services...
View Tutorial          By: vara at 2008-11-18 02:07:17