0% found this document useful (0 votes)
2 views

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.

Uploaded by

munmamun9
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

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.

Uploaded by

munmamun9
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

C Programming

01

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

Write a C program to print the numbers


from 1 to 5 using a while loop.

You might also like