Please answer as soon as you can. What will be the output of the following C++ code? #include using namespace std; main() { double a = 21.09399; float b = 10.20; int c ,d; c = (int) a; d = (int) b; cout << c <<' '<< d; return 0; } a) 20 10 b) 10 21 c) 21 10 d) 10 20
Q: What will be the output of the following C++ code? #include using namespace std; int…
A: Question. What will be the output of the following C++ code? #include <iostream>…
Q: Write a single C++ statement that will: Print the last digit of any number stored in an integer…
A: C++ program: #include <iostream> #include <string> using namespace std; intmain(void)…
Q: #include using namespace std; int main ( ) { static double i; i =…
A: #include <iostream> using namespace std; int main ( ) { static double i;…
Q: PROBLEM: Write a program that prompts the user to input coefficients A, B, and C of a quadratic…
A: #include <iostream>using namespace std; int main(){ int A, B, C; //Declaring variables.…
Q: is an operator which returns the memory size requirements in terms of bytes. * Size of Long Size…
A: Part 1) a) Size of Is correct option Explanation:- "To find the size of any variable or a data…
Q: 1. Write output of the following C code? #include #include int main() { struct tm *ptr; time_t t;…
A: Given, Code: #include<stdio.h> #include<time.h> int main() { struct tm *ptr;…
Q: the following C++ code? with the explanation reason of your choice. For example: #include int…
A: I have provided the reason for this answer in step 2.
Q: Q3/ Write a C++ program, using function, that reads two integers (X and Y) and add them (3,5)?
A: cin used for user input cout used for displaying something in console <iostream> cin…
Q: What will be the output of the following C++ code? 1 #include 2 int main() 4 int p - 123 int t-…
A: task: is to give output of the code provided in the question.
Q: Give output for c++ code #include using namespace std; int x = 1; int main() { int x = 2;…
A: Given Data : Given the C++ Code with main function. The task is to give the output of the code.
Q: Write a complete C++ program that: 1) Prompts the user to enter from the keyboard two numbers of…
A: To find sum of two numbers in C++, we will first take two numbers as input from user using cin…
Q: What will be the output of the following C++ code? #include using namespace std; int main() { int…
A: Given the following C++ code we have to find the output of the code :
Q: What would be the output of the following code? Also write printf statement instead of Cout…
A: Question :
Q: Write a C++ code that calculates the value of f(x) depending on the value of x as follow (use…
A: C++ is one of the most popular programming languages developed by Stroustrup at Bell Labs. The basic…
Q: What will be the output of the following C code if the system time is 4:27 PM? #include #include int…
A: In strftime, the passed format specifier is %H which donotes hour in 24 hour format, %p which…
Q: What will be the output of the following C++ code? #include using namespace std; int main() {…
A: Question. What will be the output of the following C++ code? #include <iostream> using…
Q: What will be the output of the following C++ code? #include using namespace std; int main() {…
A: Given: What will be the output of the following C++ code? #include <iostream>using namespace…
Q: What is the output of the following C++ code? #include using namespace std; class X { int m;…
A: Given the C++ program, the output of that program is given below with explanation.
Q: Write a C++ code that calculates the value of f(x) depending on the value of x as follow (use…
A: C++ is one of the most popular programming languages developed by Stroustrup at Bell Labs. The basic…
Q: #include using namespace std; int main() { char *ptr; char Str[] = "abcdefg"; ptr = Str; ptr…
A: Given, C++ code: #include <iostream> using namespace std; int main() { char *ptr; char…
Q: Write a complete C++ program that: Part (3) ??
A: 3. Algorithm: Start Read 2 float values Convert them into string Define a function and pass each…
Q: mmend/change the Following C programming code according to requirement :- Requirement :- I want to…
A: It is defined as a general-purpose, high-level language that was originally developed by Dennis M.…
Q: What is the output of the following C++ code? #include using namespace std; void f(int x, int& y) {…
A: The answer will be 11 12(option 2) Explanation:- In the given program, call by value and call by…
Q: Write the output of the following C++ code? #include using namespace std; class rect { int x, y;…
A: Que. Write the output of the following C++ code? Ans. Given, Programming language = C++ Code:…
Q: Question 18 What will be the output of the following C++ code? #include using namespace std; void…
A:
Q: My program in C++ runs, but does not provide me with my needed ouput, and I cant seem to find my…
A: the retail value is not correct, make it to 199.
Q: hat will be the output of the following C++ code? #include using namespace std; int main() {…
A: Given, Code: #include <iostream> using namespace std; int main() { int i; for (i = 0; i…
Q: Write a C program that opens file1 which only contains this line: dcab and then opens the empty…
A: C code:- #include <stdio.h> #include <unistd.h> #include <fcntl.h> int…
Q: Q/Consider the C-programs below to determine the following requirements : 1- Write a brief…
A: Enter a number to calculate it's factorial 5 output:- fam(5)=120
Q: PROBLEM: Write a program that prompts the user to input coefficients A, B, and C of a quadratic…
A: #include <iostream>#include <math.h>using namespace std; int main(){ int A, B, C;…
Q: Write a C++ code that calculates the value of f(x) depending on the value of x as follow (use…
A: We will have to write the function that will accept the number from user and will return the result…
Q: Q/ Consider the C-programs below to determine the following requirements: 1- Write a brief…
A: Array in C: An array is a set similar type of objects or elements stored at contagious memory…
Q: My prompt for my C++ problem is to write a program that accepts command line arguments and to print…
A: Create a C++ program which will shows either true or false for first and last string…
Q: What will be the output of the following C++ code? 1. #include 2. using namespace std; 3. int…
A: Given, Code: #include <iostream> using namespace std; int main() { int a = 5, b = 6,…
Q: What is the output of the following C++ code? #include using namespace std; int x = 1; int main() {…
A: GIVEN: What is the output of the following C++ code? #include<iostream>using namespace std;int…
Q: What will be the output of the following C++ code? #include using namespace std; int main()…
A: Given, Code: #include <iostream> using namespace std; int main() { int i, j; j = 10; i =…
Q: Write a C++ code that calculates the value of f(x) depending on the value of x as follow (use…
A: C++ is one of the most popular programming languages developed by Stroustrup at Bell Labs. The basic…
Q: 3. What will be the output of the following C++ code? #include using namespace std;…
A: 3. What will be the output of the following C++ ? #include <iostream> using namespace…
Q: include using namespace std; int main() { float num1 = 1.1; double num2 = 1.1; if (num1 == num2)…
A: Please find the answer below :
Q: What will be the output of the following C++ code snippet? 1. #include 2. using namespace std; 3.…
A: Given, Code: #include <iostream> using namespace std; int operate (int a, int b) {…
Q: 2.What is the output of the following C++ code? int x; int y: int *p int *q 35; *p 98: *p = *q; cout…
A: We are given C++ code where we are using pointers . We are going to find out the output of the code.…
Q: What is the output of the following C program? #include int main (int argv, char* argc[]) { int x =…
A: Hi, Please find your answer below, I Hope it Helps and you understand the solution.
Q: a) While trying to compile the following C source code, the C compiler complains that there are a…
A: The problem is based on finding error,output and modifying the C program.
Q: Provide both flowchart and pseudo-code for below C program code please? #include #include #include…
A:
Q: Hi. Can you solve this question? Write a c program dist.c that calculates the distance between two…
A: #include <stdio.h>#include <math.h> int main() { float x1, y1, z1, x2, y2, z2, distance;…
Q: #include int main() { const int *p; int a=10; p=&a; printf("%d",*p); return 0; }
A: The output of the following c code #include<stdio.h>int main(){const int *p;int…
Q: 2. Write output of the following C code? #include #include int main() { struct tm *ptr; time_t t;…
A: Given, Code: #include<stdio.h> #include<time.h> int main() { struct tm *ptr;…
Q: 3. Write output of the following C code? #include #include int main() { struct tm *ptr; time_t t;…
A: Given, Code: #include<stdio.h> #include<time.h> int main() { struct tm *ptr;…
Please answer as soon as you can.
What will be the output of the following C++ code?
#include <iostream>
using namespace std;
main()
{
double a = 21.09399;
float b = 10.20;
int c ,d;
c = (int) a;
d = (int) b;
cout << c <<' '<< d;
return 0;
}
a) 20 10
b) 10 21
c) 21 10
d) 10 20
Step by step
Solved in 2 steps with 1 images
- What is the output of the following C++ code? (2, 3) Submit your answer to dropbox. inti=1; int num=2; while(i<5) { num-num*i; i=i+1; } cout<<"i="<<i<<"and num="<<num<<endl;Correct and detailed answer will be Upvoted else downvoted. Thank you! What will be the output of the following C++ code? #include <iostream>using namespace std;int main(){float f1 = 0.5;double f2 = 0.5;if (f1 == 0.5f)cout << "equal";elsecout << "not equal";return 0;}3. What will be the output of the following C++ code? #include <iostream> using namespace std; int main() { float num1 = 1.1; double num2 = 1.1; if (num1 == num2) cout << "Canada"; else cout << "US"; return 0; }
- What will be the output of the following C++ code? #include <iostream> using namespace std; int main() { float f1 = 0.5; double f2 = 0.5; if (f1 == 0.5f) cout << "equal"; else cout << "not equal"; return 0; }I am needing assistance with the following program build in C++. To make telephone numbers easier to remember, some companies use letters to show their telephone number. For example, using letters, the telephone number 438-5626 can be shown as GET LOAN. In some cases, to make a telephone number meaningful, companies might use more than seven letters. For example, 225-5466 can be displayed as CALL HOME, which uses eight letters. Write a program that prompts the user to enter a telephone number expressed in letters and outputs the corresponding telephone number in digits. If the user enters more than seven letters, then process only the first seven letters. Also output the – (hyphen) after the third digit. Allow the user to use both uppercase and lowercase letters as well as spaces between words. Moreover, your program should process as many telephone numbers as the user wants.a) What is the risk of using strcpy() in C given the code below? void f1(char *str2) { int y; char str1[10]; strcpy(str1, str2);
- The language we are using here is in Racket. Please enter the following code: (cond ((equal? 16 3) (+ 3 8)) ((equal? 16 8) 12) (else (* 6 3))) Write the return value for the above code. If replacing all of the 16's in the above code with 8, what is the return value? What about replacing the 16’s with 3? What does the cond function do?I need your help with the question attached, Your writing your program in C# . When writing or printing out the output of your code please use the format when writing your code and when you want to print out the data too static void Main(string[] args) { int student_id; int student_pass, highest_avgerage_id, student_fail; student_pass = 0; student_fail = 0; highest_avgerage_id = 0; Console.Write("Enter a student id (0 to quit): "); student_id = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("Number of student who are moving on: " + student_pass); Console.WriteLine("Number of student who are not moving on: " + student_fail); if (student_id == 0) { is_continue = false; break; } This is the format I need any tutor working on this to use when they are solving the problem and writing the code in C# please. Please let me know if…What will be the output of the following C++ code? #include <iostream>using namespace std;int main(){int a = 5, b = 6, c, d;c = a, b;d = (a, b);cout << c << ' ' << d;return 0;}a) 5 6b) 6 5c) 6 7d) 6 8
- What will be the output of the following program in C++? #include<iostream> using namespace std; int x = 1; int main() { int x = 2; { int x = 3; cout << ::x << endl; } return 0; }What will be the output of the following program in C++? #include<iostream>using namespace std;int x = 1;int main(){int x = 2;{int x = 3;cout << ::x << endl;}return 0;}Hi. Can you solve this question? Write a c program dist.c that calculates the distance between two points and prints the result on the screen. The cartesian coordinates of the points would be given in the command line as 6 parameters. Your program should check if the number of arguments provided is correct and that the six coordinates are valid numbers of type double dist.exe x1 y1 z1 x2 y2 z2 For example, to calculate the distance between the two points (0, 0, 0) and (1, 1, 1), the program would be run as: dist.exe0 0 0 1 1 1 and the screen output would be 1.73205