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

Java program to get location meta data from an image

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

Archived Comments

1. Exception in thread "Thread-0" java.lang
View Tutorial          By: Ghulam Murtaza at 2012-12-12 06:43:58

2. In the above example..where you make the GC1 objec
View Tutorial          By: prasad at 2014-12-11 11:12:28

3. HI,
I am getting this error
Error lo

View Tutorial          By: vijay bhanu at 2009-07-18 08:57:57

4. Hi Dear All

How to do strike-out in

View Tutorial          By: Sandeep Mehta at 2012-11-21 06:54:06

5. yes. Client needs to use printwriter, especially w
View Tutorial          By: Aksh at 2011-07-06 03:30:46

6. hi!
please tell how i got the java comm api

View Tutorial          By: suresh at 2010-08-22 03:29:06

7. Wow NIce
View Tutorial          By: Zahid ALi at 2015-01-16 22:35:45

8. your code helps a lot.....
thanx......

View Tutorial          By: beh at 2009-08-19 06:06:20

9. thanks a lot fo the help offered.
View Tutorial          By: Douglas [email protected] at 2012-10-31 05:37:04

10. very nice and i need the code for this.. can u sen
View Tutorial          By: bala at 2008-05-14 04:51:07