int main { char c 11 char d 12 printf("%d %d \n", c, d); printf ("%d \n" printf ("%d \n", c & d) d); C unsigned char n printf("%d %d \n", n, c); unsigned char m = d << 2; printf ("%d %d \n", m, d) C >3;
Q: char A,B.C: int F; A = 2; B = 6; C = -10; F= (A+B)*C; C= E+10:
A: F = (2 + 6) * -10 F = 8 x -10 F = -80
Q: Suppose x and y are int variables and symbol is a char variable. Assume the following input data:38…
A: [Note: We’ll answer the first three subparts of the question since the exact one wasn’t specified.…
Q: #include int main() { char a = '\012'; printf("%d", a); return 0; }
A: Please find the answer below :
Q: (Temperature Conversions) Write a program that converts integer Fahrenheit temperaturesfrom 0 to 212…
A: Answer: Program: * This C program is used to convert temperature * * Fahrenheit in ranging from 1 to…
Q: 1 + 2.0F + 3.0M Select the correct data type that the above expression evaluates to in C# O int…
A: In C# programming ,it is must to specify the suffix to use for the data type value to set whether it…
Q: int s=0, d, x-42; while (x > 0) { d x 8 10; s = s*10 + d; x = x / 10; cout << s < endl; O a. 34 O b.…
A: Initial value of x=42 The while loop will run till the point value of x>0.
Q: int t1 = 0, t2 = 1; // initialize the next term (3rd term) int nextTerm = t1 + t2; // get no. of…
A: THe answer is
Q: include int main() { char a = '\012'; printf("%d", a); return 0; }
A: Please find the answer below :
Q: def myF(): x = 2 %3D y = 10 %3D x+= y*x+1 return X print (myF ()) Select one, a. 20 b. 23 c None
A: The given code is: def myF(): x=2 y=10 x+=y*x+1 return x print(myF())…
Q: #include int main() { int x = 20; int y = 22; if (x<y) { printf("Variable x is less than y"); }
A: As x is less than y it enters if statement.
Q: main() { int i = 45, c; c = multiply (i* 1000); printf ("\n%d", c); } check (int ch) { } if (ch >=…
A: In the place of multiply(i*1000) we should place check(i*1000) because there is no predefined…
Q: main(){ int y=20; int x=20; int z; z=(x*y)-2; cout<<z;} C++
A: Output for the given c++ code is given below.
Q: while (i> 20);{Cout>>i;A program to print only 20 integer number * true O False if (x > 0) cout << "…
A: Answer: I have given answered in the handwritten format in brief explanation
Q: int main() { int a = 320; char *ptr; ptr =( char *)&a; printf("%d",*ptr); return 0; } (А) 320 (В) 60…
A: AS we know the values in memory can we stored in big endian and little endian format. In little…
Q: #include using namespace std; int fib(int n) { if (n >n; cout << "The next number in the Fibonacci…
A: Given To know about the C++ programing language.
Q: int function(int num1, int num2) { if (num2 == 0) return 1; if (num2 % 2 == 0) return function(num1…
A: the question tells us to trace the execution of the program. the program basically is recursive…
Q: c) int sum(int n) { if (0 == n) { return 0; } else { return n + sum(n); } } d) void product(void) {…
A: Given: We have to Find the error (s) in each of the following program segments.
Q: Can you please correct this code #include #using namespace std; int main() { int n;…
A: #include <iostream> #using namespace std; int main() { int n; cout<<"Enter:";…
Q: 1 char mein( int c, char i) // correct this statement c = 50; i = (char)c; cout << (int)c + i <<…
A: When we pass the parameter by the reference we pass the pointer address containing the value and…
Q: #include using namespace std; Bint main() {// Start // Declare variable char str[100] = "I am a…
A: Flow chart for the above c++ code is:
Q: #include main () { int x; float y; y = x = 7.5; printf("x=%d y=%f", x, y); }
A: Here we have given the code .we have to find the output for this.. Here first two line are…
Q: Program to remove errors */ #include int main() int num1, num2, num3; printf("enter first number…
A: Hint: - letters are case sensitive. semicolon is mandatory at the end of statements.
Q: int x = 8,y; forly 0; y<=3; y++) x/- 2; cout << x +x << endl;
A: In the above code, it has been asked to print , the input, output and the code screenshot along with…
Q: Q2: Complete the following code: def calc(a, b): # This function returns the sum and the difference…
A: def calc(a,b): return a+b,a-b
Q: Given the declarations int m = 25, n=77; char c = '*'; int *itemp; Describe the errors in each…
A: The Answer is in Below Steps
Q: void main() { 1. float A,B,C; 2. clrscr(); 3. printf("Enter number 1:\n"); 4. scanf("%f", &A); 5.…
A: Answer :-
Q: int s(int x, int y): int main() int a, b̟c; scanf(*%d %d",&a,&b); c = s(a,b); printf("%d",c); return…
A: The Answer for the c program is
Q: 3.main () { char a; int y; a=97; y=98; printf(“%c\n",x); printf(“%c\n",y); printf(“%c\n",a+2);}
A: Explanation: #include <stdio.h>int main(){ char a;//declaring character variable int…
Q: Find errors from the following statements: ) f (12+90<5+6 6) ii) If (5+-12 cn 8) i) char A "1"; iv)…
A: A computer language's syntax is a collection of rules that specify the symbol sequences that are…
Q: Show the printout of the following code: int i = '1';int j = '1' + '2';int k = 'a'; char c = 90;cout…
A: Show the printout of the following code: int i = '1';int j = '1' + '2';int k = 'a'; char c = 90;cout…
Q: int x = 40, y= 8; 1. Write a line of code to print 0 if x is an odd number. 2. Write a line of code…
A: int x =40, y=8; 1. line of code to print 0 if x is an odd number…
Q: #include int main() { int x = 1; if (x > 0) printf("inside if\n else if (x > 0) pnint f("incide…
A: The output of the given c code
Q: a. int c = 5 + (int) (Math.random () * 50); b. int c = 5 + (Math.random () * 50); 3) Which of the…
A: 1) option a. 5+(int)(Math.random()*50); generates random number from 5 to 54 both inclusive 2)…
Q: #include int main() { Y float n; printf("Enter Number: "); scanf("%f", &n); sq = n*n; printf("Cube…
A: Dear Student, I think you just want to print square of number instead of cube of number, the…
Q: The program segment has errors. Find as many as you can. // This code should add two user-entered…
A: Step 1:- Program:- #include <iostream>using namespace std;int main(){int num1, num2; char…
Q: Find the error(s), if any 1) void main() { int a = 15; float b = 10; char cha = 'a'; char chb =…
A: 1.) Following errors are present in the given code: //statement with error void main() Error: As the…
Q: a. int c -20 + (int) (Math.random () 60) ; 4) Which of the following statements generates a random…
A: We are going which is correct option to generate a random number between 20 and 80 both inclusive.…
Q: int a=10, b=15; test (b,a); test (a,b); cout<<a <<b<<endl; int test (int &x, int y) { x=66; y=44;}
A: Here &x denotes that first parameter is passed as reference and y means its passed by value. In…
Q: C++ main(){int i; int j; int y; i=9;j=3; y=(i/j)-(3*i^2)/9; cout<<y;}
A: #include <iostream>using namespace std; int main() { int i; int j; int y; i = 9;…
Q: * Q: Find the result main () {int x,number1, number2; cout>number1; cout>number2; x=…
A: As per the policy and guidelines of Bartleby we are supposed to answer only first question or the…
Q: For code below, r= int x=28; int r: r= x%5; printf ("%d", r);
A: Task :- find out the value of variable r for given code.
Q: What is wrong in the following function?
A: Answer: Explanation: In the above program, the function f() return type is void and does not return…
Q: int a=10 , b=3; int c=++b; printf("%d",c); O c=2 c=3 c=4
A: There are two code snippets given. 1) int a=10,b=3; int c=++b; printf("%d",c); Provide the…
Q: int a=10 , b=3; int c=++b;printf("%d",c); O c=2 c=4 c=3
A: Answer : - c = 4 Explanations : - here c = ++b is known as pre - increment. so here first value…
Q: X Q.The output of this program isint main () ( char namel]-"OOP using C++; cout<<"Name is "<<name;…
A: A. Solution for 1st mcq - Given : char name[] = "OOP using C++"; cout<<"Name is"…
Q: 5. main () { char a; int y; a=97; y=98; printf(“%c\n",x); printf(“%c\n",y); printf(“%c\n",a+2);}
A: code with comments: main(){ char a; //initializing charcter a int y; //initializing charcter…
Q: Write a program that asks the user to enter an integer and then display the hexadecimal…
A: The program that asks the user to enter an integer and then display the hexadecimal representation…
Q: main() { int n, i = 0, c; printf("Enter the number of terms\n"); scanf("%d", &n); printf("Fibonacci…
A:
Q: m=0; do Q/lf m is an integer variable, then when the following code is executed, the print output {…
A: Let us see the answer below,
Consider the following code. What will be printed out by the code?
Trending now
This is a popular solution!
Step by step
Solved in 9 steps with 6 images
- int main() { int i, salary[10], range[9]={0, 0, 0, 0, 0, 0, 0, 0, 0}; double gross[10], total[10]; string amount[9]={"$200 - $299", "$300 - $399", "$400 - $499", "$500 - $599", "$600 - $699", "$700 - $799", "$800 - $899", "$900 - $999", "$1000 and over"}; for (i=0; i<10; i++){ cout<<"Please enter gross sales of salespeople "<<i+1<<": "; cin>>gross[i]; total[i]=200+(gross[i]*0.09); salary[i]=total[i]; if (salary[i]>=200 && salary[i]<=299) range[0]=range[0]+1; else if (salary[i]>=300 && salary[i]<=399) range[1]=range[1]+1; else if (salary[i]>=400 && salary[i]<=499) range[2]=range[2]+1; else if (salary[i]>=500 && salary[i]<=599) range[3]=range[3]+1; else if (salary[i]>=600 && salary[i]<=699) range[4]=range[4]+1; else if (salary[i]>=700 && salary[i]<=799) range[5]=range[5]+1; else if (salary[i]>=800 && salary[i]<=899) range[6]=range[6]+1; else if (salary[i]>=900…int fun(int k){ return ( ); void main(){ int n; cin >> n; n = n * fun(n); <-- 1 Fill in the appropriate statement and expression in fun, so that when it is called in main, and after the execution of the statement marked 1, the value of n would always be n3.Given the declaration:char myStr[26];char yourStr[26] = "Arrays and Strings";a. Write a C++ statement that stores "Summer Vacation" in myStr.b. Write a C++ statement that outputs the length of yourStr.c. Write a C++ statement that copies the value of yourStr into myStr.d. Write a C++ statement that compares myStr with yourStr and stores the result into an int variable compare.
- int FindSmallestVal() { int num = 0, min = 0; // reads num until the num > 0 while (num <= 0) { cin >> num; // finds the min value in the min,num min = num < min ? num : min; } // returns min return min; }Given the declaration:char str1[20];char str2[15] = "Fruit Juice";mark the following statements as valid or invalid. If a statement isinvalid, explain why. a. strcpy(str1, str2);b. if (strcmp(str1, str2) == 0)cout << " str1 is the same as str2" << endl;c. if (strlen(str1) >= strlen(str2))str1 = str2;d. if (str1 > str2)cout << "str1 > str2." << endl;#include <stdio.h>int main(){int d;int s[20],i, j, p, lg=0,m,t=0;char c;printf("Enter number of sale: ");scanf("%d", &d);for(i=0; i<d; i++){ printf("\n sales %d sales: ",i+1);scanf("%d", &s[i]);}for(i=0; i<d; i++){for(j=i+1; j<d; j++){if(s[i] > s[j]){p= s[i];s[i] = s[j];s[j] = p;}}}printf("\n sales lowest to highest: ");for(i=0; i<d; i++){printf("\nsales %d ", s[i]);}printf("\n highest: %d ",t);getch();} it should be: highest : 2000
- Print "userNum1 is negative." if userNum1 is less than 0. End with newline. Assign userNum2 with 4 if userNum2 is greater than 9. Otherwise, print "userNum2 is less than or equal to 9.". End with newline. C codechange normal body temperature to 36.5–37.5 °C #include<iostream>using namespace std;int main(){ float temp;cout<<"Enter the body temperature in Celsius\n";cin>>temp;if (temp>=37){cout<<"The quarantine of the patient is required\n";cout<<"Enter the name of the patient\n";string patient;cin>>patient;cout<<"Where the passenger is from\n";string place;cin>>place;cout<<patient<<" from "<<place<<"is to be quarantined at Hospital"; }cout<<"Normal temperature\n";}Solve the Problem with C++ (Financial application: compare loans with various interest rates)Write a program that lets the user enter the loan amount and loan period in number of years and displays the monthly and total payments for each interest rate starting from 5% to 8%, with an increment of 1/8.Sample RunLoan Amount: 10000Number of Years: 5Interest Rate Monthly Payment Total Payment5.000% 188.71 11322.745.125% 189.28 11357.135.250% 189.85 11391.59...7.875% 202.17 12129.978.000% 202.76 12165.83
- units = int(input(" Please enter Number of Units you Consumed : ")) if(units < 50): amount = units * 2.60 surcharge = 25 elif(units <= 100): amount = 130 + ((units - 50) * 3.25) surcharge = 35 elif(units <= 200): amount = 130 + 162.50 + ((units - 100) * 5.26) surcharge = 45 else: amount = 130 + 162.50 + 526 + ((units - 200) * 8.45) surcharge = 75 total = amount + surcharge print("\nElectricity Bill = %.2f" %total) Find the error and resolve the problem.// *************************************************************** // Identify the incorrect code by line number (i.e. 1, 6, 18). Enter one line number in each answer box. // This code snippet is from a program that inputs chararacters from // UART RX1, echos back chars+1. // *************************************************************** 1.#include "pic24_all.h" 2.#include "std_io.h" 3.int main(void) { 4. uint8_t u8_c; 5. 6. configClock(); 7. configDefaultUART(DEFAULT_BAUDRATE); 8. 9. printf("\nHello World!\n"); 10. 11. // Echo character + 1; 12. while (1) { 13. u8_c = inChar(); //get character 14. outChar(u8_c); //echo the character 15. u8_c++; //increment the character 16. outChar(u8_c); //echo the character 17. } // end while (1) 18.} File the two missing partError; the string "int16_t" and "int8_t" must occur somewhere in your code. where to put those string into he code Here is my code: #include <stdio.h> typedef struct define { short mantissa; char exponent; } Float24_t;