1. Write a program to print Prime numbers
Q: Q4. Write a program to read a number and calculate if it is prime or not?
A: #include <iostream>using namespace std; int main() { int i, n; bool isPrime = true;…
Q: Q3 (A) write a program to find the Y value when: 2 - 10 <x< 0 Y = x = 0 x² + 4 0 <x<7 2.
A: Note: As there is no Programming Language is mentioned So I will solve this problem using Java.…
Q: 5. Write a program to print even numbers from 1 to 10, print every number in a separate line.
A: use loop to iterate from i=1 to 10. use if statement and mod operator to check if i%2==0…
Q: 5. Write a program to display the result, as int and float, half, the sum of 10.5 and 21
A: float half sum is directly calculated. int half sum is not directly calculated use the type…
Q: 1- Write a program to find the average of 50 numbers and print the result.
A: Note: We are only allowed to solve one question in one post. I am solving the first one here. please…
Q: 1- Write a program to read a sequence of number (n), then print the times repeat of a specific…
A: Required: A program to find how many times a number is repeated in a sequence. Required code with…
Q: 3- Write a program to print the days of the week when we enter its number
A: Module VBModule Sub Main()dim n as integer = System.console.readline() select case n case 1…
Q: 17. Write a program that calculates and print the numbers (from 0 to 10) and it squares and cubes.
A: Mathematically we know that square of a number is its multiplication by itself. For example if n is…
Q: v. Write a program that inputs the age of different persons and counts the number of persons in the…
A: Code : #include<stdio.h> #include<conio.h> void main() { int i,n,age[100],count=0;…
Q: 10. Write a program that computes the sum: 7 k! R = -2 + k
A: code :- import mathvalue = 0.0 def factorialofvalue(n): return 1 if (n==1 or n==0) else n *…
Q: Q1\ Write a program to convert temperatures from Fahrenheit to Celsius and Kelvin. Program…
A: Language used C++
Q: Write a program that prompts the user to enter three integers and displays them in increasing order.
A: PROGRAM CODE: print("Enter three integers:…
Q: Exercise 9: Write a program to calculate the area of a triangle given the length of its three sides…
A: I will be taking input from user all three sides and then refer below for code: import math…
Q: Write a program that prompts the user to enter three integers and display the integers in…
A: Given:
Q: 5. Write a program that prints a Christmas tree, as shown below. Remember to use escape sequences.…
A: The above program is solved using Java Program below:
Q: B: write a program to enter two numbers and print the largest number.
A: Introduction the question is about programing language of visual basic and here is the solution in…
Q: Q7: Write a program to read 3 numbers, and write the largest and smallest numbers.
A: Program description: n is user input which stores the number of integers to be read. a is an integer…
Q: 1. Write a program that lets the user guess whether a randomly generated integer would be even or…
A: Algorithm / steps : Generate the random number Ask the user guess for even or odd Incase…
Q: 1. Write a program that will swap two numbers by just using two variables only. You need to ask for…
A: Given: Programming: C#
Q: Q4: write a program to read 10 numbers .and print all number is a prime
A: As No Programming language is mentioned, writing this program in C++ Code : #include…
Q: 1.write a program to find the average of even and the average of odd numbers from 20 entered…
A: Hi, Since there are multiple questions in this post, as per our policy, I'll answer the first…
Q: 3- Write a program to read a sequence of integers (n), then print the number of the positive and…
A: Start Input value of n from user For n times Input number If number greater than 0, then increment…
Q: 7. Make a program that will convert an inputted number in inches (in.) and display its equivalent…
A: The problem is based on the basics of C programming language.
Q: Lab p-4) Write a program that prints the sum of the even numbers and the products of odd numbers on…
A: function main(): Start Declare number, arr[10], i, sum = 0, product = 1 Read number Read integers…
Q: Q1: Let n and m be any positive integers. Write a program to calculate п т T = i=0 j=0
A: The program is written in C Language. Check the program screenshot for the correct indentation.…
Q: 1. Write a program that reads in an integer and breaks it into a sequence of individual digits. For…
A: Please find the answer below :
Q: 2)If a five-digit number is input through the keyboard, write a program to print a new number by…
A: Below is the C++ code. Approach of Program: Include a necessary header files and use a namespace to…
Q: 1- Write a program to compute the value of y: y = 1+++ 3 25 .+ Where 3 49
A: As per our guidelines, we are supposed to answer only one question. Kindly repost the remaining…
Q: s Write a program to read three numbers and prints the biggest one. طباعة ارقم الأكر من ثلالة ارقام…
A: Question :-
Q: 10. Write a program to find the value of the series 1 + 3 +5 + 7 +.. .+ 150
A: Write a program in any programming language(as there is no specific programming language mentioned)…
Q: Q1\ Write a program to convert temperatures from Fahrenheit to Celsius and Kelvin.
A: While doing programming in any programming language, you need to use various variables to store…
Q: 3. Create a program that will input a number in kilowatt and display its equivalent measure in…
A: As per our company guidelines we are not supposed to answer more than one question per post and…
Q: Write a program that prompts the user to enter two integers.
A: Since the programming language is not mentioned in the question, we will answer this question in C++…
Q: Q5): write a program to read an integer from 1 to 7 and print th name of the day in a week.
A: Using array of weekdays: Or alternative code using switch statement:
Q: Write a program to read a sequence of integers (n), then print the number of the positive and…
A: Required: Write a program to read a sequence of integers (n), then print the number of the positive…
Q: Q6: Write a program to find value of (U, 0 and p).
A: Program code provide below makes use of two header files. One for the standard input and output and…
Q: 1. Write a program that takes a two digit number and prints the number backwards.
A: As per the rules of Bartleby i can only solve 1 question at a time if they are not interrelated so…
Q: Exercise 1:1 write a program that reads three variables of real type, and then prints in ascending…
A: write a program that reads three variables of real type, and then prints in ascending order.
Q: Write a program to check whether a entered number is perfect number or not.
A: Below is a required C++ code.Program Approach: Include a necessary header file and use the…
Q: Q1: Write a program that input four grades for six students and output a. The grades summation for…
A: #include<iostream.h>#include<conio.h> #include<dos.h> void main ( ) {…
Q: 4. Write a program that computes the following equation: 1 2 y = 1+ - + - ... .2 xn
A: I have answered this question in step 2.
Q: 4. Write a program that approximates the value of cos 3 using the series 36 324 cos 3 1- 3² 34 + 2!…
A: ALGORITHM:- 1. Declare a variable of double type to hold the running sum of the series. 2. Use a…
Q: PRG10: Write a program that accepts dates written in numerical form and outputs in complete form. :5…
A: Answer: Given data program that accepts dates written in numerical form and outputs in complete…
Q: Q2) Write a program to read a group of numbers between 1 to 100, then find the sum of the even…
A: PROGRAM CODE: #include <stdio.h> void main(){ int i, num, odd_sum = 0, even_sum = 0;…
Q: 1. Write a program to read 2 numbers. Display the greatest of all.
A: Note: Answering the first question as per the guidelines. Input : Read two integers Output :…
Q: Q1/ write a program to enter a number from(1-100) and find sum odd number only
A: Find Your program Below #include <stdio.h> int main(){ int n,sum=0,i; printf("Enter a…
Q: 1- Write a program to compute the value of y: 25 + 49 3 y = 1+++ Where 5
A: Since the language is not mentioned, I have done the first question using Python 3.
Step by step
Solved in 3 steps with 3 images
- 2. Write a program to check whether the given number is even or odd.Write a program to read 2 numbers. Display the greatest of all.1_ Write a program that reads a character and prints it only if it is 'y' or 'Y' (Simulation of If-Else then structure). 2_Write a program that prints the odd numbers between 1 and 10 using loop (Number 1 ASCII code is 49).
- 7) Write a program that reads an integer and uses a single variable to add 5 to the integer, multiply by 6, and divide by 2. The program displays the remainder. * Test your program using the integer 8. * C++Create a program to accept a number and identify if this number is even or odd numberWrite a program that asks the user to enter two numbers, obtains the two numbers from the user and prints the sum, product, difference, and quotient of the two numbers.