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

Лабы / ЭТМО / DDDDDD7

.CPP
Скачиваний:
30
Добавлен:
16.04.2013
Размер:
393 б
Скачать

#include <stdio.h>
#include <conio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
main()
{
clrscr();
int n,i;
float x,a;
printf(" Enter \"N\" : "); scanf("%i",&n);
printf(" Enter \"A\" : "); scanf("%f",&a);
//if (n<=0)
//{ printf("N must be positive !!");
//  getch();
//  return(0); }
for(i=0;i<=n;i++) x+=pow(-1,i)*pow(a,i);
printf("\n %f",x);
getch();
}
Соседние файлы в папке ЭТМО