-
Recent Posts
Recent Comments
Archives
Categories
Meta
Tag Archives: #else
Mastery 16
Comments Off on Mastery 16
Posted in Blogs, Syndicated, TC1017 Blogs
Tagged #CCourses, #else, #Mastery16, #TC1017
mastery 16
here is my code for mastery 16 showing the use of “else” as a conditional.
here is my code for masteries 15 and 16
#include <iostream>
using namespace std;
int main(){
int a, c, d;
char b;
cout <<“does it move? 1) yes 2) no”;
cin >> (a);
if (a == 1) {
cout << “should it move? 1)yes 2)no”;
cin>>(c);
if (c == 1) {
cout << “then no problem 8)”;
}
else {
cout << “then use duct tape”;
}
}
else {
cout <<“Should it move? 1)yes 2)no”;
cin >>(d);
if (d==1) {
cout << “then use DW40”;
}
else {
cout <<“then no problem 8)”;
}
}
return 0;
}
Comments Off on mastery 16
Posted in Blogs, Syndicated, TC1017 Blogs
Tagged #coding, #else, #include, #Mastery16
Mastery16
#Mastery16 #TC1017 #else #conditional
Using conditionals is really useful when you want to execute an action depending of the result of other action; to do that we use “if” and “else” conditional; but when you want to validate more than one condition you have to use “else if” conditional.
First of all we need to know what is the structure for this conditonals, in this link you will find a pp that explain “else” and “else if” conditionals with detail:
https:/
The following picture shows a c++ code using conditionals.
Finally, I found information about that in this link:
http:/
Comments Off on Mastery16
Posted in Blogs, Syndicated, TC1017 Blogs
Tagged #conditional, #else, #Mastery16, #TC1017