3
Is there a bug in my program when I try to find the odd and odd pair of a float variable.
#include<stdio.h>
#include<string.h>
void exe7(float vet[]){
int i;
for(i=0;i<5;i++){
scanf("%f",&vet[i]);
}
for(i=0;i<5;i++){
if(vet[i] %2 ==0){
vet[i+5]=vet[i]+0.02;
}
if(vet[i] %2 !=0){
vet[i+5]=vet[i]+0.05;//vet[i+5] pois será armazenado em outra posição;
}
}
for(i=0;i<10;i++){
printf("%f",vet[i]);
}
}
main(){
float vet[10];
exe7(vet);
}
Look, if this is a college exercise, just know that the teacher(a) may have a soul or a brain, but not both. Parity is a property of integer numbers only. Integers do not have parity.
– Oralista de Sistemas