2. Write a program to print even/odd numbers
Q: Write program to print odd numbers from 1-N,each 10 numbers in line
A: Write a program to print odd numbers from 1- n, each 10 numbers line.
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: (B) Write a program to print the value of z x+y³, x2+y* z = 3! ... 4! 5!
A: Suppose x=2, y=2 and number of terms is 3, we have : z= (1+22)/3!) - (2+23)/4! + (22+24)/5! z=(5/6)…
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: 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: Write a program to calculate velocity of a car when distance and time are given by the user.
A: C Programming: C programming is a procedural language that was developed in Bell Laboratories by…
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: 9. Write a program to print out all Armstrong numbers between 1 and 500. If sum of cubes of each…
A: Here let's define a function sumCube() to find sum of cube of digits.
Q: write a program to output the square of odd integers between 1 and 50 using FOR/NEXT statemen
A: VB code: Module VBModule Sub Main() Dim i As Integer ' for next loop execution from1 to…
Q: Write a program to read a number and calculate if it is prime or not?
A: Java code for the problem. Includes, 1. Read a number as input. 2. Display whether it is prime or…
Q: 9. Write a program to print out all Armstrong numbers between 1 and 500. If sum of cubes of each…
A: Since the programming language isn't mentioned, we will use the C language We will run a loop to…
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: Write a program to read four degrees and calculate the sum and average of them, and print it
A: As no programming language is mentioned here so i attempted this question in c++
Q: Write a program to check whether a given number is even or odd.
A: C program to check whether a given number is even or odd
Q: Write a program to convert temperatures from Fahrenheit to Celsius and Kelvin
A: Here no programming language is mentioned i attempted this question in c the program take input…
Q: Write a program to display a prime numbers between 1 and 1000.
A: Since the programming language is not mentioned, we'll do it in python The programming methodology…
Q: Write a program that asks the user to input 10 numbers and counts how many odd numbers that user…
A: Algorithm:- (I) declare array of size 10. (II) using loop take input . (III) use modulo 2 to…
Q: 3. Make a program to display all EVEN numbers from 1 - 100.
A: The question has been answered in step2
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: Write a program that asks the user to input three numbers and calculates their maximum
A: Required: A program to ask the user three numbers and print the maximum. Required code with…
Q: Write a program to check a given number if it is prime or not?
A: c++ program for prime number is given below with output
Q: s Write a program to read three numbers and prints the biggest one. طباعة ارقم الأكر من ثلالة ارقام…
A: Question :-
Q: 3. Write a program to read 20 integer numbers, each number consist of 3 digits, then find the number…
A: // Taking 20 numbers of three digits and storing them to a list numbers = [] for i in range(20):…
Q: 4. Write a program to calculate and print the sum of all multiples of 7 from 1 to 100.
A: Pseudocode for the given problem FOR i := 1 to 100 DO // for loop that…
Q: ?write a program to read 4 numbers and find the sum and average إجابتك
A: Since no programming language is mentioned, I am using python Algorithm: Start Read 4 numbers…
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: 2. Write a program to print the summation of integer numbers that are greater than 10 and lees than…
A: Algorithm: Include header file and namespace std Create a main function Initialize the variable…
Q: 2. Write a program that read two integers then print the even and odd number (using functions).
A: A number is even if it is perfectly divisible by 2. When the number is divided by 2, we use the…
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: 1. Write a program to print Prime numbers
A: Given:-
Q: Write a program to take input an integer from user and print the sum of all the digits of the number…
A: Given: An integer taken input from user. Requirement: Write a program in JAVA language to print the…
Q: print your name characters in this way
A: C Code: #include <stdio.h> #include <string.h> int main() { int length;…
Q: Write a program to ask the user to enter integers continuously, and calculate the summation and…
A: Please find the answer below :
Q: Write a program that reads 6 integers and displays the largest and the smallest amongst those…
A: C++ code: To displays the largest and the smallest amongst 6 integers #include <iostream>using…
Q: Write a program to read 2 numbers. Display the greatest of all.
A: PROGRAM CODE: #include <iostream> // include header file for input output…
Q: Write program to generate random numbers in different ranges and display the number: (a) a number in…
A: We need to write a program to generate random numbers as per the given scenario. ***Programming…
Q: //write a program to convert the seconds to minutes and hours like 00:00:00 :-
A: Program: Programs are the instructions given to the system in order to perform specific tasks. The…
Q: 4- Write a Program to calculate the electromagnetic force between two electrons placed (in vacuum)…
A: Given: Charge of an electron q = 1.6*10-19C Distance between the electrons = 2*10-13 m K= 9*109 The…
Q: Write a program to print odd numbers from 1 to 60.
A: Module VBModule Sub Main() Dim num, odd(50), o As Integer Console.WriteLine("Odd…
Q: write a program to read number to find prime or not prime
A: NOTE: As the language is not mentioned, the below code is C++ language. Algorithm: Initialize…
Q: write a program to read a numbers 4 and find the smallest number
A: write a program to read a numbers 4 and find the smallest number NOTE: Since you have not…
Q: Write a program that reads the integers between 1 and 50 and counts the occurrences of each. Assume…
A: To write program reading integers 1 and 50 and count, print the occurrence of each.
Q: Write a program to check if the last digit is greater than 5,then compute the sum of digits.and…
A: Program Approach - Define the main function and declare the variables for the program. Prompt user…
Step by step
Solved in 2 steps with 2 images
- 2. Write a program that converts a hexadecimal digit into a decimal value. (The output of your program should be like the following but you should try different numbers.) Enter a hex digit: AB7C You must enter exactly one character Enter a hex digit: B The decimal value for hex digit 8 is 11 Enter a hex digit: 8 The decimal value for hex digit 8 is 8 Enter a hex digit: T T is an invalid input2. Write a program to check whether the given number is even or odd.1. Write a program to print Prime numbers
- 6. Write a program that reads in an integer and breaks it into a sequence of individual digits. For example, the input 16384 is displayed as 16384 You may assume that the input has no more than five digits and is not negative.1. Write a python program to find the sum of all even numbers from 0 to 10 2. Write a python program to read three numbers (a,b,c) and check how many numbers between 'a' and 'b' are divisible by 'c'Write a program that reads two integers, a and b, from the user. Where a is equal to 17 and b is equal to 4. The program should compute and display the following: i. Sum of a and b. ii. Difference when b is subtracted from a. ii. Result of a. iv. Remainder when a is divided by b.
- Write a program to read 2 numbers. Display the greatest of all.4) Write a program that reads three numbers and prints "all the same" if they are all the same, "all different" if they are all different, and "neither" otherwise.1. Write a program that does the following: - reads an unspecified number of integers - determines how many positive and negative values have been read - computes the total and average of the input values (not counting zeros). Your program ends with the input 0. Display the average as a floating-point number. If the entire input is 0, the program displays "No numbers are entered except 0". Here is a sample run: Enter integers ending with e: 1 2 -1 3 e The number of positives is 3 The number of negatives is 1 The total is 5 The average is 1.25 2. A pentagonal number is defined as n(3n-1)/2 for n= 1, 2, ..., etc.. Therefore, the first few numbers are 1, 5, 12, 22, .... Write a method with the following header that returns a pentagonal number: public static int getPentagonalNumber(int n) For example, getPentagonalNumber(1) returns 1 and getPentagonalNumber(2) returns 5. Write a test program that uses this method to display the first 100 pentagonal numbers with 10 numbers on each line.…
- Write a program that reads ten integers, and then display the number of even numbers and odd numbers. Assume that the input ends with 0.Question: Run a program that checks whether the number is even or oddA palindromic number is a number that is the same when written forwards or backwards. The first few palindromic numbers are therefore are: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 22, 33, 44, 55, 66, 77, 88, 99, 101, 111, 121, 323 Input a number from the user. Write a program that reverses the digits of a number. Use this program to find if the number is a palindrome. Print if the number is palindrome or not.