This time we will attempt to make C + + program to show the need for letters of numbers entered through the user. So for example user menginputkan number 85 it will display the letter A. Problem selengkapkanya are as follows:
By using the IF statement, produce a program to show the letter from the value entered by the user, with sebegai following provisions:
If the value is more than 80, then the value of letter = AIf the value is more than 75, then the value of letter = BWhen the value is more than 65, then your worth of letter = CWhen the value is more than 45, then your worth of letter = DWhen the value is less than or comparable to 45, then your worth of letter = EIf the input value is greater than 100 or less than 0, it will display the content "input one".
To create a C + + program displays the value of letters as a matter of the above, we can use the IF statement. Here's the origin code C + + program to show the value of the letter:
By using the IF statement, produce a program to show the letter from the value entered by the user, with sebegai following provisions:
If the value is more than 80, then the value of letter = AIf the value is more than 75, then the value of letter = BWhen the value is more than 65, then your worth of letter = CWhen the value is more than 45, then your worth of letter = DWhen the value is less than or comparable to 45, then your worth of letter = EIf the input value is greater than 100 or less than 0, it will display the content "input one".
To create a C + + program displays the value of letters as a matter of the above, we can use the IF statement. Here's the origin code C + + program to show the value of the letter:
02 # include <conio.h>
03
04 void main ()
05 {
06 court <<"Value Program Letter" <<endl;
07 int bil;
08 court <<"Enter the number:";
09 cin>> bil;
10 if (bil> 100 | | bil <0)
11 court <<"input one";
12 else if (bil> 80)
13 court <<"The value of letter = A";
14 else if (bil> 75)
15 court <<"The value of letter = B";
16 else if (bil> 65)
17 court <<"The value of letter = C";
18 else if (bil> 45)
19 court <<"The value of letter = D";
20 else
21 court <<"The value of letter = E";
22 getch ();
23}
Explanation from the program displays the need for the letter:
According to the provisions in question, then we must ensure when the input is above 100 or below 0 it will display the message "input one", therefore first tested if the input is above 100 or below 0. Further testing from the new input values ??to look for the value of the letters according to the provisions under consideration.
According to the provisions in question, then we must ensure when the input is above 100 or below 0 it will display the message "input one", therefore first tested if the input is above 100 or below 0. Further testing from the new input values ??to look for the value of the letters according to the provisions under consideration.
0 komentar: On Showing Value Letter By IF
Posting Komentar