Q1: Write a C++ program to accept two characters and check weather they are numbers or not ?if they are numbers add them ?
Q: Give output for c++ code #include using namespace std; int x = 1; int main() { int x = 2; { int x =…
A: Solution. Given, Programming language = C++ Code: #include<iostream> using namespace std;…
Q: 3. What is the output of the following C++ program? int x, y; for ( x = 1; x <= 4; x ++) for ( y =…
A: nested for loops are used in the given:all the statements inside a loop will run until condition of…
Q: Q6: Write a C++ program that use any logical and rational operators?
A: Code: #include <iostream>using namespace std;int main() { int n1 =10,n2=5,n3=7,n4=8…
Q: Q1/ Write a program in C++ to print the MUL parameter value (note: * (MUL=result*9, result=y-x, y=8…
A:
Q: QT. Write a c++ program that takes a positive integer number and displays all the factors of that…
A: Given:
Q: 2- Write a C++ program to ask the user to enter his/her first and second name. After that, ask them…
A: Algorithm : Step 1 : declare string variables. Step 2 : ask for the first name from user. Step 3 :…
Q: Vowel or Consonant? Write a program in C++ that prompts the user to provide a single character from…
A: Five alphabets a, e, i, o and u are called vowels. And except these 5 alphabets and the remaining…
Q: short answers : c)Give an example of a common floating point arithmetic error due to the particular…
A: an example of a common floating-point arithmetic error due to the particular way in which…
Q: What is the output of the following C++ programs? Part A # include # include # include # include…
A: Both the above programs have two header files included. One is iostream.h, which is for input/output…
Q: 01: write a program in c++ Language to insert two integer numbers and then swap these numbers by…
A:
Q: 15 Write a C++ program that displays the results of the expressions 3.0*5.0.7.1*8.3- *.2.2, and…
A: #include <iostream> using namespace std; int main(){ float expr1,expr2,expr3; expr1…
Q: What will be printed when the following C code is executed? #include int main() { if('A'<'a')…
A: Answer: The Char variable has an ASCII value of its own. The characters are thus compared according…
Q: Q.3 Write a C++ program that calculates the volume of a solid cone. The formula is: volume = ((0…
A: Formula of volume of sphere: (πr2h)/3 Below is the required code in C++. Program Approach: Include…
Q: Q5. Write program in C++ to find the factorial of a number? by using for- statement and start from 1…
A: Factorial of number is a multiply the number with all the number from that number till 1 Example 5!…
Q: HW2: Write a C Program that read a number from the keyboard and find wether the number is a or (9l…
A: Prime number : A number is said to be a prime number if only if the number has two divisors 1 and…
Q: iii) Write a C program to find the value of x after taking the value of y. Where x,y are two…
A: Step-1: Start Step-2: Declare a integer variable y and x Step-3: Take input from user for y Step-4:…
Q: Q1/Write a program in C ++ that raises a number to powers without using the command pow(,) is…
A: This program will take two numbers from the user (a base number and exponent) and calculates the…
Q: Q2// Write C++ program to read three numbers and find the sum of odd numbers that are dividable on 3…
A: Required: Required code with comments for explanation and screenshot of both code and output has…
Q: Q2 / Write a program in C++ to calculate the remaining volume by placing a hard ball inside a cube…
A: The logic behind finding remaining volume: Volume of cube = (length)3 The ball is a sphere So volume…
Q: Q6: Write a C++ program that Create a variable called z, assign x + y to it, and display the result?
A: The given requirement is to write a program in c++ where a variable named z is declared and a…
Q: Q3/1/ Write a program in C++language, to read three numbers and then after the number with the…
A: PROGRAM INTRODUCTION: Include the required header files. Start the definition of the function in…
Q: 40. Write a program in C++ that reads ten names then ask user to enter name then print the number of…
A: Coded in C++.
Q: What will be the output of the following C++ code? * #include using namespace std; void fun(int ,…
A: Output is 10 As x delclared in function definition as x=20 is vanished after coming out of fun…
Q: 2. Write a C++ program that computes the sum of integer numbers divisible by 6 that are from 20 to…
A: #include <iostream>//iostream included for outputusing namespace std;int main(){ //2 int…
Q: 3. What is the output of the following C++ program? int x, y; for (x = 1; x <= 4; x ++) { for (y =…
A: Dear Student, Here ++x pre increment operator value is incremented before expression is executed.…
Q: Examine the following C++ code and determine the output. int x; x = 7.5 + static_cast(7.4) /2; cout…
A: Given Program, #include <iostream> using namespace std; int main() { int x; x =…
Q: Is the following are correct C++ statement? cout << "Programming with C++!'<< endl:
A: cout is used to print contents onto screen
Q: What would be the output of the following C code? int main(void) int x, y;
A: I have provided solution in step2
Q: 3. Write a C++ program that computes the number of decimal digits in a positive integer number using…
A: The required code is as follows:-
Q: What is the output of the following code in C? #include main() { int a=2; for( ;a;) printf(“…
A: In this code written in C language , we should have knowledge of for loop to understand this:- Lets…
Q: - Q1 /B: Write a program in c++ to print even numbers and odd numbers?... اكتب برنامج بلغة سي بلس…
A: required: Write a c++ program to print if a number is even or odd. Required code with comments…
Q: What WilL BE THE OUTPUT OF THE FOLLOWING C CODE? 1. 2. 3. #include int x; void main() {…
A: In the given code, the variable 'x' is initialised before void main() function and also no value is…
Q: 2- Write a C++ program to ask the user to enter his her first and second name. After that, ask them…
A: 1. Write a C++ Program which takes three string as input(first, second and third name) and merge it…
Q: : Write a program in C to check a given number is even or odd.Using the function with no arguments…
A: Given: Q #2: Write a program in C to check a given number is even or odd.Using the function with no…
Q: Q3/ Write a program in c++ to get the length of a string enter by a user?
A: We will be using strlen function to get the length of string entered by user , we will store the…
Q: 2. Write a C++ program to input a string from the user that contains 5 positive integers of 2-digits…
A: Take the input of numeics And that values in string type. Read the input values Find the maximum…
Q: Q2// Write C++ program to read three numbers and find the sum of odd numbers ? that are dividable on…
A: ALGORITHM:- 1. Take input for 3 elements. 2. Initialize a variable that will store sum with 0. 3.…
Q: 6. Write a C++ program that computes the number of decimal digits in an entered positive integer…
A: #include<iostream> using namespace std; int nodec(int num)…
Q: 3- Write a program in C++, to read a number and calculate the average of the digits it consists of,…
A: The program is written in C++ Please find the program in the following step.
Q: In C++ write a program to perform all mathematical operations on two variables?
A: Code: #include <iostream>using namespace std; int main(){ int num1, num2, ad,sub,mul;…
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: 1- Write a C# program that read a string and Compute the count of "The" in this string. Ex : if…
A: Here, we are going to write a C# program that read a string from user and compute the count of word…
Q: What is the output of the following C++ program segment? Assume all variables are properly declared.…
A: Considering the for loop to be for( j=0; j<8; j++) instead of for(j=0; j<8; j11) The for loop…
Q: 5- Write a C program that reads a number and check whether its' prime or not. Note: a prime number…
A: Write a C program that reads a number and check whether it's prime or not. A prime number is that…
Q: Q1/ write a program in C++ that reads 15 numbers, calculates and prints the sum of every three…
A: #include <iostream> using namespace std; int main() { float arr[15]; float sum = 0;…
Q: Q1;- write c++ program to read an integer number and check if it is positive or * ? negative
A: Answer Program Purpose: 1. The software needs a numerical input. 2. It's determined whether it's…
Q: 2- Write a program c ++... What happens if the variable of type int is given a value of more than…
A: Write a program c ++... What happens if the variable of type int is given a value of more than…
Q: 8. Write a C++ program that concatenates two strings using the function char* concatstrings (char*,…
A: C++ Code :- #include <iostream>#define MAX_SIZE 100 // Maximum size of the stringusing…
Q: 2- Write a program in C to print a welcome text in a separate line 3- Write a program in C to add…
A: #include <stdio.h> int main(){ printf("\n\nProgram to Print a welcome text in a separate…
Step by step
Solved in 2 steps
- You have two integers stored in variables var1 and var2. Make C # Program to determine if one of the integers is more than 10 but not both?what is the output of the following c++ statement: int a, b, c, d; a = 5; b = 4; c = (++b + a--); cout << a << " " << b << " " << c << endl;Q7/ Write a program in C++ that asks the user to enter two numbers and prints the sum, product and difference of the two numbers by using function (Where there are three functions, the first for addition, the second for multiplication, and the third for subtraction).
- 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";elsecout << "US";return 0;}Q10/ Write a program in c++ that converts Celsius to Fahrenheit according to the following equation: F = 9/5 C+32 .By using functionsa. Write a c program that asks a user for an integer. Declare a variable num3. Let num3 = --x; Display the values of x, and num3.b. Write a c program that asks a user for an integer. Declare a variable num4. Let num4 = x--; Display the values of x, and num4.
- What is the output of the following C++ program segment? Assume all variables are properly declared. for (j = 0; j < 8; j11){cout << j * 25 << " - ";if (j != 7)cout << (j + 1) * 25 - 1 << endl;elsecout << (j + 1) * 25 << endl;}Q8/Write a program in C++ that reads in two integers and determines and prints if the first is a multiple of the second by using functions.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 is the output of the following C++ code? #include<iostream>using namespace std;int x = 1;int main(){int x = 2;{int x = 3;cout << ::x << endl;}return 0;}Q1 : Write a program in C ++ to evaluate the equation below : Y = + sin x - x modulus2 3Q #2: Write a program in C to check a given number is even or odd 1. Using the function with no arguments and no return values