use C programming stdio.h enter a number:5 output : 5,10,15,20,25,20,15,10,5 enter a number :3 output : 3,6,9,6,3 * TERMINATION ______________________________________________________________________ second PROBLEM C PROGRAMMING STDIO.H N1 N2 OUTPUT 0 0 GOT7 POSITIVE EVEN POSTIVE EVEN N1+N2 POSITIVE ODD POSITIVE ODD N1 x N2 NEGATIVE EVEN NEGATIVE EVEN MARK TUAN NEGATIVE EVEN NEGATIVE ODD JACKSON WANG WITH TERMINATION ___________________________________________________________________________ 3RD PROBLEM USING C PROGRAMMING STDIO.H the 1ST INPUT is 5 2ND input 13 output : 5, 8 ,13 *TERMINATION ---------------------------------------------------------------------- last question c programming stdio.h I think the problem starts before the nested if switch because at the end of the code it should output the result of sales = quantity * price and change = payment - total amount and asking quantity and Payment #include<stdio.h> main() { int choice,ch,Quantity,Payment; printf(" SELECT 1 OPPO \n SELECT 2 SAMSUNG \n SELECT 3 HUAWEI \n\n\n CHOICE: "); scanf("%d",&choice); switch(choice){ case 1: printf("\n OPPO!!!"); printf("\n\nSelect 1 oppo F11 \n Select 2 OPPO A5S \n select 3 OPPO F9 PRO \n\n CHOICE: "); scanf("%d",&ch); switch(ch){ case 1: printf("\n Oppo F11 smartphone was launched in March 2019. The phone comes with a 6.50-inch touchscreen display.\n"); printf("\n P 18,990.00"); break; case 2: printf("\n Oppo A5s is built quite sturdily and feels light in hand considering its large footprint.\n"); printf("\n P 6,990.00"); break; case 3: printf("\n Oppo F9 Pro features a dual rear camera setup.\n"); printf("\n P 15,990.00"); break; } break; case 2: printf("\n SAMSUNG!!!"); printf("\n\nSelect 1 SAMSUNG GALAXY A10\n Select 2 SAMSUNG NOTE 10\n select 3 SAMSUNG S9\n\nCHOICE: "); scanf("%d",&ch); switch(ch){ case 1: printf("\n SAMSUNG Galaxy A10 is not a light smartphone, but it is also rather large, making its heft appropriate at least.\n"); printf("\n P 6,990.00"); break; case 2: printf("\n The Galaxy Note 10 is Samsung’s easiest to use S Pen-toting phone yet, and while there may not be any game-changing features to make this a must-buy handset, it’s a solid addition to the Note range.\n"); printf("\n P 53,990.00"); break; case 3: printf("\n The Samsung Galaxy S9 features a 12MP rear camera with dual-aperture technology. This is the big takeaway from the S9.\n"); printf("\n P 45,990.00"); break; } break; case 3: printf("\nHUAWEI!!!"); printf("\n\nSelect 1 HUAWEI P30 \n Select 2 HUAWEI NOVA 5T \n select 3 HUAWEI NOVA 3I\n\n CHOICE: "); scanf("%d",&ch); switch(ch){ case 1: printf("\n The Huawei P30 has one of the best cameras we've seen in a phone, with features like incredible optical zoom and night mode that other handsets could only dream of, but other than that it feels more like a decent mid-range handset than a flagship.\n"); printf("\n P 50,990.00"); break; case 2: printf("\n Hiding the front camera beneath the screen, HUAWEI nova 5T’s screen retains its full integrity, revolutionizing user experience.\n"); printf("\n P 14,990.00"); break; case 3: printf(" \n HUAWEI nova 3i provides three color models for you to choose from, Pearl White, Black and Iris Purple. With beautiful hues of color on the back glass and metal mid-frame, you will enjoy wonderful visual and handling experience.\n"); printf("\n P 14,990.00"); break; } break; default: printf("\n TRY AGAIN CHOOSE YOUR PHONE BRAND WISELY!!!"); } scanf("%d", &quantity); total Amount = quantity * price; scanf("%d", &payment); scanf("change = Payment - total Amount); getch(); }
use C programming stdio.h
enter a number:5 output : 5,10,15,20,25,20,15,10,5
enter a number :3 output : 3,6,9,6,3
* TERMINATION
______________________________________________________________________
second PROBLEM
C PROGRAMMING STDIO.H
N1 |
N2 | OUTPUT |
0 | 0 | GOT7 |
POSITIVE EVEN | POSTIVE EVEN | N1+N2 |
POSITIVE ODD | POSITIVE ODD | N1 x N2 |
NEGATIVE EVEN | NEGATIVE EVEN | MARK TUAN |
NEGATIVE EVEN | NEGATIVE ODD | JACKSON WANG |
WITH TERMINATION
___________________________________________________________________________
3RD PROBLEM USING C PROGRAMMING STDIO.H
the 1ST INPUT is 5
2ND input 13
output : 5, 8 ,13
*TERMINATION
----------------------------------------------------------------------
last question
c programming stdio.h
I think the problem starts before the nested if switch because at the end of the code it should output the result of sales = quantity * price and change = payment - total amount and asking quantity and Payment
#include<stdio.h>
main() {
int choice,ch,Quantity,Payment;
printf(" SELECT 1 OPPO \n SELECT 2 SAMSUNG \n SELECT 3 HUAWEI \n\n\n CHOICE: ");
scanf("%d",&choice);
switch(choice){ case 1: printf("\n OPPO!!!"); printf("\n\nSelect 1 oppo F11 \n Select 2 OPPO A5S \n select 3 OPPO F9 PRO \n\n CHOICE: "); scanf("%d",&ch);
switch(ch){ case 1: printf("\n Oppo F11 smartphone was launched in March 2019. The phone comes with a 6.50-inch touchscreen display.\n");
printf("\n P 18,990.00");
break;
case 2: printf("\n Oppo A5s is built quite sturdily and feels light in hand considering its large footprint.\n");
printf("\n P 6,990.00");
break;
case 3: printf("\n Oppo F9 Pro features a dual rear camera setup.\n"); printf("\n P 15,990.00");
break; }
break;
case 2: printf("\n SAMSUNG!!!"); printf("\n\nSelect 1 SAMSUNG GALAXY A10\n Select 2 SAMSUNG NOTE 10\n select 3 SAMSUNG S9\n\nCHOICE: ");
scanf("%d",&ch);
switch(ch){
case 1: printf("\n SAMSUNG Galaxy A10 is not a light smartphone, but it is also rather large, making its heft appropriate at least.\n"); printf("\n P 6,990.00");
break;
case 2: printf("\n The Galaxy Note 10 is Samsung’s easiest to use S Pen-toting phone yet, and while there may not be any game-changing features to make this a must-buy handset, it’s a solid addition to the Note range.\n");
printf("\n P 53,990.00");
break;
case 3: printf("\n The Samsung Galaxy S9 features a 12MP rear camera with dual-aperture technology. This is the big takeaway from the S9.\n"); printf("\n P 45,990.00");
break;
}
break;
case 3: printf("\nHUAWEI!!!"); printf("\n\nSelect 1 HUAWEI P30 \n Select 2 HUAWEI NOVA 5T \n select 3 HUAWEI NOVA 3I\n\n CHOICE: "); scanf("%d",&ch);
switch(ch){
case 1: printf("\n The Huawei P30 has one of the best cameras we've seen in a phone, with features like incredible optical zoom and night mode that other handsets could only dream of, but other than that it feels more like a decent mid-range handset than a flagship.\n");
printf("\n P 50,990.00");
break;
case 2: printf("\n Hiding the front camera beneath the screen, HUAWEI nova 5T’s screen retains its full integrity, revolutionizing user experience.\n"); printf("\n P 14,990.00");
break;
case 3: printf(" \n HUAWEI nova 3i provides three color models for you to choose from, Pearl White, Black and Iris Purple. With beautiful hues of color on the back glass and metal mid-frame, you will enjoy wonderful visual and handling experience.\n");
printf("\n P 14,990.00");
break;
}
break;
default:
printf("\n TRY AGAIN CHOOSE YOUR PHONE BRAND WISELY!!!"); } scanf("%d", &quantity);
total Amount = quantity * price; scanf("%d", &payment);
scanf("change = Payment - total Amount);
getch();
}
Step by step
Solved in 4 steps with 4 images