Q2: Write a program in C++ language to read (numl, num2) as integer numbers then calculate the value of result (res), as follow: numl + num2 if numl >num2 if num2 > num1 numl * num2 res = numl - num2 if numl = num2
Q: in C++ to print a string in reverse using a pointer. Write a program A sample run is shown below:…
A: #include <iostream> using namespace std; int main(){ char str[100]; //reading a string…
Q: In c++ write a program that reads 10 numbers and then selects the largest number and prints it and…
A: Question. In C++ write a program that reads 10 numbers and then selects the largest number and print…
Q: 1. Write a program in C++ to print your full name and the sum of two numbers and determine if the…
A: ALGORITHM:- 1. Take input for the name from user. 2. Take input for the numbers from the user. 3.…
Q: Write a program in C++ to count total number of notes in given amount
A: Given: Write a program in C++ to count total number of notes in given amount.
Q: prints words of a string in reverse order for example if a user enter “I love programming ” it…
A: / C++ program to prints words of a string in reverse order */ #include <iostream>#include…
Q: In C language, write a program to input two integers x,y and add both the integers using pointers…
A: Given To know about the c language add two number using pointer and display the result of output
Q: Write a program in C that does the following. The program starts by offering the user the following…
A: // C program for the implementation of // menu driven program for student // management system…
Q: C++, >> is called ?
A: Here is the detailed and simplified answer to the above listed problem statement:
Q: Write a program that prompts the user to enter the number of students and each student’s name and…
A: Given :- Write a program that prompts the user to enter the number of students and each student’s…
Q: write a program in c++ Language to print the ASCll of any character by using this rule ASCll of…
A: This is simple example of casting
Q: Write a program in C that replace a particular word by another word in a given string. For example…
A: Here we will write a program in C that replace a particular word by another word in a given string.
Q: Read input 5 integer variables from user in C++ and print the sum of only those numbers which are…
A: If any number is odd then then number%2 is not equal to 0 otherwise number%2==0 if number is even.
Q: char *pl, *p2; pl = &a; p2 = &d; printf("p1 = %c p2 = %c", *p1, *p2); %3D %3D Write a segment in C…
A: I have modified the given code as follows, it satisfies your condition for output. Please upvote…
Q: a. Write a c program that asks a user for an integer. Declare a variable num1. Let num1 = ++x;…
A: C programming is a procedural-oriented programming language that does not include classes and…
Q: Vrite a simple C program that can determine whether a machine is little- or big-endian. 2. Printing…
A: Answer: I have given answered in the brief explanation
Q: Take a number from user and print it's multiplication table. You have to do it in c language.the…
A: Requirements:- Take a number from the user and print it's the multiplication table. You have to do…
Q: Q3/ A/ Write a program in C++ to find the sum of the series: a=5+2+4+8+10+--+n
A: Answer is given below .
Q: in C++ language, write a program Function 1: takes as input a string, ONE character, and an integer…
A: Program plan: Define a function stringOperation() that is overloaded in the program. Define…
Q: Write a program in C++ which adds, subtracts, multiplies, divides, and perform exponentiation on two…
A: Algorithm: Start Select the operation to be performed Read two numbers a,b If user selected…
Q: Write a program in C that carries out simple mathematical operations entered as a command-line…
A: Complete C program for question - 1: #include <stdio.h> #include <stdlib.h> #define bool…
Q: Write a program in c++ to determine the count of numbers divisible by 7 and also display the…
A: Program Approach - Use the essential header files as per program requirements. Define the main…
Q: Write a program in C++ that takes your full name as input and displays the abbreviations of the…
A: Given: Write a program in C++ that takes your full name as input and displays the abbreviations of…
Q: pointers in c++.
A:
Q: 1. Write a C program that will use an amray that stores 3 numbers. Then, the program vwill detemmine…
A: The algorithm to find the smallest and largest numbers in an array is given below. Input the array…
Q: Write a program in C write a program that inputs six strings that represent integers, convert the…
A: #include <stdio.h> #include <stdlib.h> #include <string.h> int main() { char…
Q: Write in C language Description Write a program to determine if a string is apalindrome or not.…
A: Hi, your code is case sensitive. for it Wow and wow is not the same. I have modified the code and it…
Q: C language Write a program that tests the below math library function: Sqrt(x), exp(x), log(x),…
A: Hey there, I am writing the required solution based on the above given question. Please do find the…
Q: the sample input is: And the sample output is ; 3 6 9 3…
A: Please find the answer below :
Q: In C, Given a char variable c that has already been declared, write some code that repeatedly reads…
A: //include the required header file #include <stdio.h> //define main function int main() {…
Q: . Refer to the statement below, #include void main() { clrscr(); char a = 'o', d= 'h'; char *p1,…
A: #include <stdio.h>void main() { clrscr(); char a = 'o', d = 'h'; char *p1, *p2; p1…
Q: Write a program in C that does the following. The program starts by offering the user the following…
A: The program where a user inputs a value to perform an operation from a menu of choice is called…
Q: This function returns the index in string s where the substring can first be found. For example if s…
A: Hey, since multiple questions posted, we will answer first question according to our policy. If you…
Q: Q2: Write a program in C++ language to read (num1, num2) as integer numbers then calculate the value…
A: Required: Required code with comments for explanation and screenshot of both code and output has…
Q: Write a program in C++ that converts kilometers per hour to miles per hour (by using static data…
A: While doing programming in any programming language, you need to use various variables to store…
Q: Write a C program using if-else. The program reads one integer number a. Then it reads one integer…
A: Here is c code of above problem. See below step.
Q: QI/ Write a program in c++ which read a sequence of 20 numbers and compute their sum when the sum>=…
A: C++ program: #include <iostream>using namespace std; int main(){ int sum = 0, num;…
Q: Q1) True/False questions: Write T for true andF for false statement. If it is false, additionally…
A: 4. Given statement is False as, in c++ constants can be declared by other datatypes also, like…
Q: Write a program in C++ that calculates a factorial Number 15
A: Code: #include <iostream> using namespace std; int main() { //prompt to enter a number for…
Q: Write a program in c++ that calls a function that returns the smallest of three floating-point…
A: Please find the answer below :
Q: Write a program in c++ to find the sum of two numbers
A: The C++ program to find the sum of two numbers is given by: #include<iostream>; using…
Q: Write a program in C++ to perform various string operations.
A: Code: #include<iostream>#include<string.h>using namespace std; int main(){ string str…
Q: Write a program in C++ to display n odd numbers and find: 1- The sum of numbers and average. 2- The…
A: Write a program in C++ to display n odd numbers and find: 1- The sum of numbers and average. 2- The…
Q: Write a complete C++ program that contains the integer functions (main, funx and funy). The main…
A: #include <iostream> using namespace std; // defination for funxint funy(int n) { // since…
Q: am trying to compile a poker program in c++ and it still doesn't work: main.cpp: #include…
A: It is defined as the programs can be asked from control statements, array, string, oops etc. Java…
Q: Sample Input 2 Sample Output 2 ** **** ** 2.
A: without stdlib we can use printf function in the following format //Declare the printf() function…
Q: Write a program in c language to compute the value of following series: x/1.2 + x2/2.3 + x3/3.4…
A: #include <stdio.h>#include <math.h>int main(){ int i,x, n; printf("Enter the value of…
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: Write a program in C++ that converts kilometers per hour to miles per hour (by using static data…
A: Required: A C++ program to convert kilometers per hour entered by the user to miles per hour.…
Step by step
Solved in 2 steps with 1 images
- You must answer the Problem in C++. (Anagrams) Write a function that checks whether two words are anagrams. Two words are anagrams if they contain the same letters in any order. For example, “silent” and “listen” are anagrams. The header of the function is as follows: bool isAnagram(const string& s1, const string& s2) Write a test program that prompts the user to enter two strings and checks whether they are anagrams. Sample Run 1 Enter a string s1: silent Enter a string s2: listen silent and listen are anagrams Sample Run 2 Enter a string s1: split Enter a string s2: lisp split and lisp are not anagramsPlease write the following program in C. Write the complete program with correct syntax. Take a string input from the user and find out whether it is a palindrome using pointers. Sample Input:AAABBAAAAABBABAaabcbaaSample Output:PalindromeNot PalindromePalindromeWrite a program in C write a program that inputs six strings that represent integers, convert the strings to integers, and calculates the sum and the average of the six values.
- Solve the problem in C++ (Anagrams) Write a function that checks whether two words are anagrams. Two words are anagrams if they contain the same letters in any order. For example, “silent” and “listen” are anagrams. The header of the function is as follows: bool isAnagram(const string& s1, const string& s2) Write a test program that prompts the user to enter two strings and checks whether they are anagrams. Sample Run 1 Enter a string s1: silent Enter a string s2: listen silent and listen are anagrams Sample Run 2 Enter a string s1: split Enter a string s2: lisp split and lisp are not anagramsYou need to write a C program that accepts an integer as input and displays the binary equivalent of an integer. The C program uses a recursive function, called binary_convert, to do the binary conversion. Binary notation represents numbers in terms of powers of two and uses only the digits 0 and 1. The initial start is given below: #include <stdio.h> /*line 1 */ int main(void) { int num; printf("Enter a number: "); /*line 2 */ /*line 3 */ return 0; } /*line 4 */ { int rem, div; /*line 5 */ { /*line 6 */ /*line 7 */ } /*line 8 */ /*line 9*/ /*line 10 */ } /* line 1 */…Translator Write a program that deals a number of cards (their numerical values) to a player's hand. To begin, the program asks the player for the values of the deck of cards to realize the program in c language. Then, the program deals the first two cards of the deck to a player's hand, and asks him if he wants another card. If he does not want a card, the program ends. If he wants a card, the program deals the next available card in the deck, adds it to the player's hand, and asks the player if he wants another card. The dealing process repeats as long as the user continues to accept cards, or until the cards in the deck run out. Card dealing involves copying the available card from the deck vector to another vector, which stores the player's hand, at the next available position. Assume that the deck of cards consists of only 10 cards with numerical values from 1 to 10, which the player will enter by keyboard before the program deals. The following functions…
- a. 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.How to solve a puzzle in c programming, using fgets, showing the unused letters? For example, the text file below should display all unused letters: l person fhi txt file: hellol person fandhi --------------------- lol and he end txt fileSolve this programming question in c++ Use the code provided below to make further changes #include<bits/stdc++.h> using namespace std; class Person { private: string name; int age; public: Person() { this->name=""; this->age=0; } Person(string name,int age) { this->name=name; this->age=age; } public: void set_name(string name) { this->name=name; } void set_age(int age) { this->age=age; } string get_name() { return this->name; } int get_age() { return this->age; } }; //custon compare function to sort by name bool compareName (Person p1, Person p2) { return (p1.get_name() < p2.get_name()); } int main() { string name; int age; Person p1,p2("Ajay Kumar",21); cout<<"Enter the name: "; getline (cin, name); cout<<"Enter the age: "; cin>>age; p1.set_name(name); p1.set_age(age); Person p3("Suman Devi",24),p4("Amit Singh",42); //vector initialization vector<Person> vec = {p1, p2, p3, p4}; sort(vec.begin() ,vec.end(), compareName);…
- C Language - Write a program with total change amount as an integer input, and output the change using the fewest coins, one coin type per line. The coin types are Dollars, Quarters, Dimes, Nickels, and Pennies. Use singular and plural coin names as appropriate, like 1 Penny vs. 2 Pennies.Write a program in C that initializes one each of the basic C data types and then print them out. Don't forget pointer. Also print the size of each.IN THE C PROGRAMMING LANGUAGE j = 15; k = 9 // what are the values for n,m,and p after these operations: --j ; k++ ; n = j - ++k; m = j-- + k--; p = k + j;