Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int Negativos(int n, float *vet) {
- for (int i = 0; i < 5; i++) {
- if ((*vet + i) < 0) {
- n++;
- }
- }
- return n;
- }
- int main()
- {
- float vetor[5];
- char Cespecial = 248;
- for (int i = 0; i < 5; i++) {
- printf("\nDigite o %d%c numero do vetor: ", i + 1, Cespecial);
- scanf_s("%f", &vetor[i]);
- }
- printf("\nNumero de negativos no vetor: %d\n\n", Negativos(0, &vetor[0]));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement