I have to create a code to create new vector which is created of range typed by user.
For ex: we start with 3 and end with 9. So i need crate vector forom 3 to 9 stepped by 0.25
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
{
float starts=0;
float ends=0;
float stepo = 0.25;
float tab[]={};
int startInt = 0;
int endInt = 0;
int counter = 0;
printf("Podaj poczatek:
");// "Type starting int"
scanf("%d", &endInt);
printf("Podaj koniec:
"); // "Type ending int"
scanf("%d", &startInt);
int diff = startInt - endInt;
printf("%d
", diff);
starts= startInt;
ends= endInt;
for (int i = 0; i< (diff)*4; i++) {
tab[i]= ends;
printf("%f
", tab[i]);**strong text**
ends = ends + stepo;
}
return 0;
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…