官术网_书友最值得收藏!

  • Learning C for Arduino
  • Syed Omar Faruk Towaha
  • 184字
  • 2021-07-09 19:10:07

Exercises

  • Write a program to check if a number is odd or even (hint: find the modulus of the number by 2, and if the modulus is equal to 1, then the number is even; else the number is odd).
  • Take inputs of three variables (Name, Age, and Email) from a user. If the age is greater than 20, print all the variables. If the age is equal to or less than 20, print "Sorry! You are not allowed!".
  • Take an input of three integers and print the largest integer (hint: follow the previous example)
  • Take the input of the marks of a student (four subjects) and find his GPA (hint: take variables as float; use if conditions to find the GPA of a subject; then add all the GPAs, pide the total with the total number of subjects, and print the value).
  • Define the days of a week from 1 to 7. Take an input of the day number, and if the day number is odd, print "Have a lovely day;" if the day number is even, print "It is a lovely day!"
主站蜘蛛池模板: 龙泉市| 台中市| 舟山市| 宜丰县| 房产| 东乡族自治县| 田东县| 湄潭县| 新丰县| 新竹市| 石泉县| 探索| 饶阳县| 河津市| 延寿县| 淮滨县| 金寨县| 芦溪县| 建宁县| 体育| 新河县| 青海省| 崇左市| 聊城市| 石家庄市| 通州市| 长阳| 武汉市| 南皮县| 武城县| 城固县| 惠安县| 富宁县| 塔河县| 鱼台县| 山西省| 辉县市| 巴马| 灌南县| 抚州市| 锡林郭勒盟|