C language please
Write the definition of a function isSenior, which receives an
integer parameter and returns true if the parameter's value is
greater or equal to 65, and false otherwise.
So if the parameter's value is 7 or 64 or 12 the function returns
false. But if the parameter's value is 69 or 83 or 65 the function
returns true.
Function:
int isSenior(int n)
{
if(n >= 65) //if parameter is greater or equal to 65 return
true.
return true;
else //if parameter is less than 65 return false.
return false;
}
Program:
#include <stdio.h>
#include<stdbool.h> //function definition.
int isSenior(int n)
{
if(n >= 65) //if parameter is greater or equal to 65 return
true.
return true;
else //if parameter is less than 65 return false.
return false;
}
int main()
{
int n=7; //declaring parameter value
if(isSenior(n)) //if function return true then print below
message.
printf("%d is senior\n", n);
else //if function return false then print below message.
printf("%d is not senior\n", n);
return 0;
}
output:
Note: my friend if you have any questions or queries comment below. I am happy to answer your questions. I will sort out your queries. Thank you my friend,
C language please Write the definition of a function isSenior, which receives an integer parameter and...
In C++, write a function isOdd() that takes one integer parameter. The function returns true if the number if odd and false otherwise.
answer in c++ please , Your objective is to write the definition of the function Equal() whose header is template <typename T> bool Equal(Node<T>* ar1,Node<T>* ar2) It returns true if the nodes of ar1 and ar2 with the same position have the same value, and ar1 and ar2 have the same length; otherwise, it returns false.
C++ programming language Write a program that contains following function: A function that receives a string of character, the function return true if the string contains letter c or C, otherwise, return false.
Using the programming language Java or C++, Write a function that takes an integer as input. Return true if this integer is a palindrome integer; false otherwise;
C++ 2. (a) Write a function, printdixisors, that takes a single integer parameter and prints all the numbers less that the parameter that are divisors of the parameter (i.e. divides it without a remainder) including 1. So printdivisors(6) will print 1,2,3. Note you may use a wrapper function or default parameters. (b) Write a function, sumdixisors, that takes a single integer parameter and returns the sum of all the divisors of the parameter (including 1). So sumdivisors(6) will return 6...
C++ ( Please Read) Write a function prototype and a function definition called getTotal that receives an array of type double, the number of rows in the array. It returns the total of all elements in the array.
C Question: Write a function p3 which receives a C string as a parameter, and an array of integers which will serve as indices into the string. The third parameter is the length of the integer array. The function jumbles the characters in the string according to the indices in the array of numbers. For example: char course [] = "CSC 373 Computer Systems I"; int indices[ ] = {0,1,4,5,6,7,0,1,25}; Then the function call p3(course, indices, 9); would cause course...
C++ [10pts] Write a function that takes as a parameter an integer (as a long value) and returns the number of odd, even, and zero digits. Also write a program to test your function.
Using C++ language please not matlab a. Write a function, called SumOfDigits that is able to calculate the summation of a five-digit number. This function receives one integer parameter 'a', then returns the sum of 5 digits of the number. [2.5 marks] b. Write a function, called Armstrong that prints all Armstrong numbers in the range of 0 and 500. An Armstrong number of three digits is an integer such that the sum of the cubes of its digits is...
Write a Python function isPrime(number) that determines if the integer argument number is prime or not. The function will return a boolean True or False. Next, write a function HowManyPrimes(P), that takes an integer P as argument and returns the number of prime numbers whose value is less than P. And then write a function HighestPrime(K) that takes integer K as an argument and returns the highest prime that is less than or equal to K. USE THE WHILE LOOP...