. Exercise 2- Problem Description Develop and run a C program that performs the following • Declare two arrays of character of size 50 called FatherName, SonName • Ask the user to enter the father name • read in the user's father name and store i

匿名用户 最后更新于 2021-11-29 17:10 计算机类Computing


. Exercise 2- Problem Description Develop and run a C program that performs the following • Declare two arrays of character of size 50 called FatherName, SonName • Ask the user to enter the father name • read in the user's father name and store it in FatherName • Ask the user to enter the son name read in the user's son name and store it in SonName • Declare a two variable of integer called FatherBirth Year, SonBirth Year • Ask the user to enter father's year of birth and store it in FatherBirthYear • Ask the user to enter son's year of birth and store it in SonBirthYear • Calculate the difference between the father birth year and son birth year in days and store it in a new integer variable DiffValue. • Print the name of the father then" is older than the name of son" by " DiffValue "days". Add your name, id, and email address as a comment at the beginning of the program Organize the output of you program similar to the following sample Sample output : . Enter Father Name Samer Enter Father Age 34 Enter Son Name Omar Enter Son Age 6 Samer is older than Omar by 10220 days Exercise 3 - Problem Description develop and run a C program that ► Displays your information properly: student name, id, and student email Declare an array of characters of size 3 called arr1 Declare an array of characters of size 3 called arr2 > Prompts (ask) the user to enter the two arrays Note: Assume the user will enter a proper characters and numbers, no need to check for improper input > The program inserts the 3 characters of the first input in the array arr1. The program inserts the 3 characters of the second input in the array arr2. After that, the program displays the number represented by subtracting the two arrays to gather (the decimal value of first character in arr1 - the decimal value of second character arr2 ...etc.) > Add your name, ld, and email address as a comment at the beginning of the program. Sample output : Student name: Samer Sawalha Student id : 9999999 Student Email: 9999999@std.psut.edu.jo Enter three characters: ABC Enter three characters: abc The result is: -32-32-32

已邀请: