0% found this document useful (0 votes)
11 views2 pages

Munachimso Nweke - Python Input Statement Practice Exercise

The document contains three programming tasks. The first task is a Python program that calculates the sum, product, and average of three user-input numbers. The second task is a Python program that collects and prints a user's full name, and the third task is a C program that converts meters to centimeters.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views2 pages

Munachimso Nweke - Python Input Statement Practice Exercise

The document contains three programming tasks. The first task is a Python program that calculates the sum, product, and average of three user-input numbers. The second task is a Python program that collects and prints a user's full name, and the third task is a C program that converts meters to centimeters.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

1) Write Python program to get three numbers from the user, and find the

sum, product and average of these numbers.

n1=int(input(“enter first number”))

n2=int(input(“enter second number”))

n3=int(input(“enter the third number”))

#initiating sum

s=n1+n2+n3

#initiating product

p=n1*n2*n3

#printing sum and product

print(“sum =”,s)

print(“product=”,p)

2) Write a program to get the first name, middle name and last name from a
user. Print out the result on a line.

firstname= input("Enter your first name:")


lastname= input("Enter your last name:")
middle= input(“Enter your middle name:’’)
greeting = "Hello there, %s %s"
print greeting % (First, Last)

3)
int main()

double meter = 40.8;


double centimeter;
centimeter = 100 * meter;
printf ("Value in Centimeter is: %.2f \n", centimeter);
return 0;
}

You might also like