السلام عليكم و رحمة الله
انا طالبة علوم الحاسوب و ادرس لغة ++ C و عندي برنامجين لازم اكتبهم و احتاج احد يكتب لي اياهم بليييييييييييييييييييييييز ضروري
و يعطيكم العافيه و جزاكم الله خير
الاسئلة هي:
Exercise 1
Write a program that reads from a file several positive integers and prints out the percentage of odd numbers and the percentage of even numbers (0 is considered to be even). Your input files contains N + 1 numbers, where the first number tells you how many numbers are in the file, and the rest of the number are the data.
Exercise 2
Write a program that reads a positive integer represented in binary form and converts to decimal form. The followi example explains how the conversion is done.
The number 1000110112 in binary equals 28310 in decimal because:
1 * 28 + 0 * 27 + 0 * 26 + 0 * 25 + 1 * 24 + 1 * 23 + 0 * 22 + 1 * 21 + 1 * 20
= 1 * 28 + 1 * 24 + 1 * 23 + 1 * 21 + 1 * 20
= 283