Суббота, 18.05.2024, 07:25
Приветствую Вас Гость | RSS
Меню сайта
Категории раздела
Вход на сайт
Поиск
Календарь
«  Май 2024  »
ПнВтСрЧтПтСбВс
  12345
6789101112
13141516171819
20212223242526
2728293031

Главная » C (задачи)

Write a function integerPower(base, exponent) that returns the value of baseexponent. For example, integerPower(3, 4) = 3 * 3 * 3 * 3. Assume that exponent is a positive, nonzero integer, and base is an integer. Function integerPower should use for to control the calculation. Do not use any math library functions.

Напишите функцию integerPower(base, exponent), которая возвращает значение baseexponent. Например, integerPower(3, 4) = 3 * 3 * 3 * 3. Предположим, что exponent является положительным ненулевым целым, а base целым. Для управления вычислением функция integerPower должна применять цикл for. Не используйте никаких функций математической библиотеки.

#include <stdio.h>

int integerPower(int, int);

int main()
{
    int base, exponent;
    
    puts("Enter base:" ... Читать дальше »

Категория: C (задачи) | Просмотров: 171 | Добавил: alex | Дата: 23.06.2018

Define a function called hypotenuse that calculates the length of the hypotenuse of a right triangle when the other two sides are given. The function should take two arguments of type double and return the hypotenuse as a double.

Определите функцию hypotenuse, которая вычисляет длину гипотенузы прямоугольного треугольника по двум другим сторонам. Используйте эту функцию в программе для определения длины гипотенузы треугольников, приведенных ниже. Функция должна получать два аргумента типа double и возвращать значение гипотенузы также типа  double.

... Читать дальше »
Категория: C (задачи) | Просмотров: 176 | Добавил: alex | Дата: 23.06.2018

« 1 2