Сделал 1е Задание по Битовым операциям
This commit is contained in:
parent
baa0509a01
commit
060d43dbcf
4 changed files with 51 additions and 0 deletions
24
BitwiseOperations/1Ex/main.c
Normal file
24
BitwiseOperations/1Ex/main.c
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
#include <stdio.h>
|
||||
#include "pow.h"
|
||||
|
||||
#define IOE "InputError!\n"
|
||||
|
||||
int main(void) {
|
||||
double number;
|
||||
int power;
|
||||
|
||||
printf("Enter your number: ");
|
||||
if (scanf("%lf", &number) == 0) {
|
||||
printf("%s", IOE);
|
||||
return -1;
|
||||
}
|
||||
|
||||
printf("Enter the power: ");
|
||||
if (scanf("%d", &power) == 0) {
|
||||
printf("%s", IOE);
|
||||
return -2;
|
||||
}
|
||||
|
||||
printf("The number %.1lf to the power of %d is %.1lf\n", number, power, bitwisePow(number, power));
|
||||
return 0;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue