Copy of Helpful Tips When Working With a Virtual Assistant
The document outlines several C programming tasks, including checking if a number is even or odd, printing the first 10 natural numbers, and calculating the sum of an array of integers. It also includes functions for calculating the average of an array, checking for prime numbers, and printing elements in reverse order. Additionally, it features a task to print numbers from 1 to 5 using a while loop.
Copy of Helpful Tips When Working With a Virtual Assistant
The document outlines several C programming tasks, including checking if a number is even or odd, printing the first 10 natural numbers, and calculating the sum of an array of integers. It also includes functions for calculating the average of an array, checking for prime numbers, and printing elements in reverse order. Additionally, it features a task to print numbers from 1 to 5 using a while loop.
Write a program that takes an integer as input and
prints whether it is an even or odd number. 02
Create a program that prints the first 10 natural numbers
using a for loop. 03
Write a program that takes 5 integers as input and stores
them in an array. Then, find and print the sum of the elements in the array. 04
Define a function called calculateAverage that takes an
array of integers and its size as parameters and returns the average of the numbers in the array. Use this function in your program to find the average of an array of 8 integers. 05
Create a function called isPrime that takes an integer as a
parameter and returns whether the number is prime or not. Use this function to print all prime numbers between 1 and 20. 06
Write a program that takes three integers as input, stores
them in an array, and prints them in reverse order. Use a function named printInReverseOrder that takes an array and its size as parameters and prints the elements in reverse order. 07