Скачиваний:
26
Добавлен:
02.05.2014
Размер:
414 б
Скачать
//Lab 2_1
#include <STDIO.h>
#include <MATH.h>
#include <CONIO.h>
main()
{ int i, N; float x, S1, S2, S3;
clrscr ();
 printf("\n Vvedite N i x: "); scanf("%d %f", &N, &x);
 S1=0; S2=0; S3=0;
 for (i=1; i<=N; i++) S1+=(x*x+1)/i;
 i=0;
 while (i<N)
     {i++; S2+=(x*x+1)/i;}
 i=0;
 do
     {i++; S3+=(x*x+1)/i;}
 while (i<N);
 printf ("\nS1=%f \nS2=%f \nS3=%f", S1, S2, S3);
getch (); return 0;
}
Соседние файлы в папке Лабораторная работа 2