program in python.
for i in range(1,21):
print(i,i*i)
output:
1 1
2 4
3 9
4 16
5 25
6 36
7 49
8 64
9 81
10 100
11 121
12 144
13 169
14 196
15 225
16 256
17 289
18 324
19 361
20 400
>>>
range(1,21) --- range is from 1 to 20 , 21 is ignored
In first iteration the 1 goes to i
In second iteration the 2 goes to i
Write a program that prints every integer value from 1 to 20 along with the squared...
C programming language
1. Write a program that prints the minimum value and the maximum value of a given array. For example array a is: int al 10] 140,30,20,50,10,80,99.90,85,70;: the minimum value is 10 and the maximum value is 99. Write a program that Converts an Integer from base 10 to base 2. 2. 3. Write a program that reads in ten marks and then calculates the pass rate
Develop a MAL program that prints an unsigned integer value in the octal system format. The program should take a decimal integer value from the user and then pass it to a procedure that converts the number to octal and prints it on the screen.
Develop a MAL program that prints an unsigned integer value in the octal system format. The program should take a decimal integer value from the user and then pass it to a procedure that converts...
Write a program file_max.c that reads a set of integer numbers from a file and prints out the maximum number to standard output. The name of the input file should be specified as a command line argument.
Write a C program that takes a positive integer n as input and prints all the prime numbers from 1 to n. Sample Input/Output 1: Enter your n: 20 Prime number(s) from 1 to 20 : 2 3 5 7 11 13 17 19 Sample Input/Output 2: Enter your n:2Prime number(s) from 1 to 2 : 2
This Java program reads an integer from a keyboard and prints it out with other comments. Modify the comments at the top of the program to reflect your personal information. Submit Assignment1.java for Assignment #1 using Gradescope->Assignemnt1 on canvas.asu.edu site. You will see that the program has a problem with our submission. Your program is tested with 4 testcases (4 sets of input and output files). In order to pass all test cases, your program needs to produce the same...
Write a program that prompts the user for a positive integer, n, and then prints a following shape of stars using nested for loop, System.out.print(“*”);, and System.out.println();. Example1: Enter a positive integer: 3 * * * * * * * * * Example2: Enter a positive integer: 5 * * * * * * * * * * * * * * * * * * * * * * * * * JAVA LANGUAGE!!
using C++ Write a program that: a) Inputs an integer n from the keyboard where n<=100. If n is out of range then print out an error message and ask for another input. This process repeats until a valid value for n is obtained. b) Inputs two 1D arrays of doubles A and B (of size n) from the keyboard. c) Inputs an integer k (from 1 to 3) from the keyboard. d) If k = 1 then it calculates...
Write a program that reads an integer greater or equal to 2, n, and prints a shape of a nline hollow inverted pyramid of stars. Your program should interact with the user exactly as it shows in the following two executions: Execution example 1: Please enter an integer, greater or equal to 2: 5 ********* -*----- * --*--- * ---*--* ----* Execution example 2: Please enter an integer, greater or equal to 2: 3 ***** -* * --*
Write the following code in C.
Write a program that takes a positive integer and prints that many stars These are sample outputs. Enter the number of stars: 9 Enter the number of stars: 4 Enter the number of stars: -3 Invalid input!
java
CountDigits.java Write a program that calculates and prints, the sum and product of all the digits in an integer value read from the keyboard.