radomes.openskiesproject.org
kersonhariakenana kersonhariakenana
  • 13-01-2017
  • Computers and Technology
Answered

C programming:


Write code to assign true to isTeenager if kidAge is 13 to 19 inclusive.


#include


#include


int main(void) {


bool isTeenager = false;


int kidAge = 0;


kidAge = 13;


/ Your solution goes here /


if (isTeenager) {


printf("Teen

");


}


else {


printf("Not teen

");


}


return 0;

Verified Answer :

rsmith6559
rsmith6559 rsmith6559
  • 19-01-2017

isTeenager = ( ( kidAge >= 13 ) && ( kidAge <= 19 ) ) ? true : false;

Another way:

if( ( kidAge >= 13 ) && ( kidAge <= 19 ) )
  isTeenager = true;
else
   isTeenager = false;

Answer Link

Related Questions

What is a scientist who studies the weatherO Weather JournalistO Meteorologist
1 23 X 34 what is the awnser with work shown
6x 8x 4y x 5y 2y
Below the C horizon is
The measured length of the coffee shop is 150mm on the floor plan The actual length is 24m determine the scale used to draw the floor plan in the form of 1
What are some snorkel strategies
evaluate how the media impacts our values and beliefs about marriage both in a positive and negative way
Use the substitution method to solve the following system of equations 4x y 3 7x 9y 2
Which of the following is an example of radiation a boiling water on the stove b sun bathing outside on a sunny day c touching a stove and getting burned d warm
What are similarities between rational and irrational numbers