1. Answer: Teenager
Rationale: The code written above commands the software to print "Child" if age is less than 13 or to print "Teenager" if age is between 13 & 19 or to print "Adult" if all other ages. The first line states that age is 15, therefore the software prints "Teenager"
2. Answer: 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20
Rationale: The code commands the software that for i lying between 1 and 100, if i is less than or equal to 20, print i. Therefore, the software prints all the numbers less than or equal to 20.
What will be printed for the code below: age = 15 if (age < 13) {...
what will be printed when you run below code in python? age=6 age=(age**2)//2 print(age) if (age >25) print("You will pay $120 per month") print("check date:") elif(age >=16) print("You will pay $90 per month") else: print("You will pay $50") print("Check payment due date") print(" Your payment is due by Oct 2019")
What will be the value of x printed by the following code (modify_x() function)? #include <stdio.h> void modify_x(void) int x 10; x+ 20 printf("X is : %d\n", x); int main(void) modify_x(); modify_x0: return O; First time:_ Second time: In earlier question (modify_x() function based), what would you do to have different values in the output upon execution of the function each time? HTML Editor
What is printed when the following code is executed? #include <stdio.h> int main() { for (int i=3, j=5; i>=0; i-=2, j+=j*i) { printf("%d", j); منم }
Question 25 What is output when the following code is executed? 65 score = group if score <= 60: group group + 'A' if score <= 70: group group + 'B' if score <= 80: group group + 'C' else: group group + 'D' print(group) BC AB с D
How many times does the message, “Hello” get printed out by the code segment below? int count = 0; while (count < 41) { printf(“Hello\n”); count = count+3; } D Question 2 1 pts How many times does the message, "Hello" get printed out by the code segment below? int count = 0; while (count < 41) printf("Helloln"); count count+3;
ed What is the output after execution of the code block {for (int i=1;i<=4; i++) {if (i==3) continue; cout<<"-"<<i; i++}} 1.00 on Select one: a.-1-3 b.-1-2 C.-1-4 O d.-2-3
Convert the below code into if else selection: #include <iostream> using namespace std; int main() { int num; sin. >> num; switch (num) { case 1: cout << "Casel: Value is: << num << endl; break; case 2: break; case 3: cout << "Case3: Value is: " << num << endl; break; default: cout << "Default: Value is: << num << endl; break; } return; }
What will the code shown below print to the console? public class Cascade public static void print(int arg){ for(int i=0; i<arg; i++){ System.out.print(""); } System.out.println(""); if(arg > 1){ print(arg-1); } } public static void main(String[] args) { print(4); } } E B IV AA- IES XX, SE V GT 12pt Paragraph -
What is the output of the following C++ code? int count = 1; int num = 25; while (count < 25) { num--; count++; } cout << count « " " « num << endl i 25 1 0 24 1 0 25 0 0 24 0 In this while loop statement, while (counter < 10), where counter is an int variable. Which statement below is an equivalent way to write this while statement? while (10 < counter) while (9...
Q4) what is the output after the code below is executed? #include <stdio.h> #1 nclude<string.h> int main) char abc[100]-"Good Luck in Your Programming Final" int i, ; while(abc[i]!= '\0'){ if(abc[i]' if(abc[i+1]-'&&abci+1] -'0' else printf"c", abcli-1]) printf("\n w = %d return 0; \n", w); Place you answer here 4 l Page