2014Apr30 - CPPS - Visual Studio Lab4b.c

1 min read

Deviation Actions

Ongpohhuatiloveu2's avatar
Published:
608 Views
/*
Name: <type your name, as shown on your student ID>
Admin No:
Class:
*/
#include<stdio.h>
void main(void)
{
/*
//Question 4 Page 2
int result4;
result=20;
result=(result*3/9<5)||(23/4*4>20);
printf("The value of result is %d\n",result4);
//Lab4a.c
int x,y,result;
x=12;
y=5;
result=(x!=y)&&(10/x>1);
printf("The value of result is %d\n",result);
*/
//Lab4b.c
float weight,height,bmi;
printf("Please enter you height in metres:\n");
scanf("%f",&height);
printf("Please enter you weight in kg:\n");
scanf("%f",&weight);
bmi=weight/(height*height);
if(bmi>25)
{
printf(
"You are overweight\n");
}
else
{
printf(
"Congratulations. You are at a healthy weight for your height\n");
}
}
© 2014 - 2024 Ongpohhuatiloveu2
Comments0
Join the community to add your comment. Already a deviant? Log In