0
How do I split multiple inputs to separate lines?
I have a code in c language that prompts two inputs but I can't run it, kindly respond.
5 Antworten
+ 3
Hi Rimwaka,
About ways to give inputs for codes, please refer to this code
https://code.sololearn.com/WhiNb9BkJUVC/?ref=app
P.S. Please tag SoloLearn as this related to a part of the platform (Code Playground input dialog).
https://code.sololearn.com/W3uiji9X28C1/?ref=app
+ 1
Post the code
+ 1
Thanks
0
#include <stdio.h>
int main()
{
int s, d;
printf("Enter s value: ");
scanf("%d", &s);
printf("Enter d value: ");
scanf("%d", &d);
printf("Value of Systolic is = %d in mm Hg.\n" ,s);
printf("Value of Diastolic is = %d in mm Hg.\n",d);
if(s<120 & d<80){
printf("Normal");
}
if(s>=120 && s<=129 & d<80){
printf("Elevated(formerly prehypertension)\n");
}
if(s>=130 && s<=139 & d>=80 && d<=89){
printf("High Blood Pressure (Hypertension) Stage 1\n");
}
if(s>=140 && s<=180 & d>=90 && d<=120){
printf("High Blood Pressure(Hypertension) Stage 2");
}
if(s>180 && d>120){
printf("Hypertensive Crisis\n");
}
return 0;
}
0
https://code.sololearn.com/ca61IfH2UZY5/?ref=app
the and operator causes the error