Function to swap values of two integer variables


Question 1) Write a function that takes one integer argument and returns its square.

Question 2) Write a function to calculate the cube of a number.

Question 3) Write a function to calculate the area of a circle where radius is passed to the function as argument.

Question 4) Write a function to calculate the area of a rectangle where length and breadth are passed to the function as argument.

Question 5) Write a function that has three arguments principle, rate and time and returns the simple interest.

Question 6) Write a function that accepts a character as argument and returns its ASCII value.

Question 7) Write a function to swap the values of two integer variables

(i) Using Extra variable

(ii) Without using extra variable.

Question 8) Write a function that has one integer argument and returns 0 if number is even else returns 1.

Question 9) Write a function that has one character argument and displays that it’s a small letter, capital letter, a digit or a special symbol.

Question 10) Write a function to print the sum and average of first n natural numbers where n is passed to the function as argument.

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: Function to swap values of two integer variables
Reference No:- TGS04904

Expected delivery within 24 Hours