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. thanks f0r this p0st... it heLped me much... keep
View Tutorial          By: martz at 2009-04-29 02:27:19

2. yes simple good it wroking goog
View Tutorial          By: durga prasad pavirala at 2009-02-11 03:43:04

3. hi everybody....

please use comm.j

View Tutorial          By: manoj at 2012-09-24 10:41:34

4. Please provide me a particular flow of validations
View Tutorial          By: Deepali at 2013-05-10 10:38:18

5. "paint() sample program to draw a line in J2M
View Tutorial          By: Carlos Alberto Urrea at 2015-02-06 14:00:14

6. Thanks it worked for me after lot of search for CO
View Tutorial          By: VIRAJ at 2012-12-26 11:56:24

7. meow is simple and awesome
View Tutorial          By: vishnu prasanth at 2013-01-10 10:00:35

8. Your Crystal report viewer showing all the records
View Tutorial          By: Neel at 2013-06-09 15:02:15

9. hello sir i want to know how to run this pogram as
View Tutorial          By: Pranjay at 2009-01-07 03:33:45

10. How can you print this using recursion?

View Tutorial          By: Menon at 2011-09-08 07:16:02