Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

Лабы / ЭТМО / DDDDDD6

.CPP
Скачиваний:
30
Добавлен:
16.04.2013
Размер:
374 б
Скачать
#include <stdio.h>
#include <conio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
main()
{
clrscr();
int n,i=0;
float x=1;
printf(" Enter \"N\" : "); scanf("%i",&n);
if (n<=0)
{ printf("N must be positive !!");
  getch();
  return(0); }
if (pow(-1,n)==1) for(i=2;i<=n;i+=2) x*=i;
else for(i=1;i<=n;i+=2) x*=i;
printf("\n %f",x);
getch();
}
Соседние файлы в папке ЭТМО