Cuenta Positivos,negativos,ceros Y Suma Por Separado En C

  • Uploaded by: Adrián Espinosa
  • 0
  • 0
  • May 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Cuenta Positivos,negativos,ceros Y Suma Por Separado En C as PDF for free.

More details

  • Words: 127
  • Pages: 2
#include <stdio.h> #include int main() { int i, num; int contcer = 0; int contpos = 0; int contneg = 0; int acupos = 0; int acuneg = 0; int pares = 0; int impares = 0; for(i=1;i<11;i++) { printf("Introduce numeros\n"); scanf("%d", &num); if (num>0) { contpos++; acupos += num; } if (num<0) { contneg++; acuneg += num; } if (num==0) { contcer++; } if (num % 2 == 0) { pares += num; } if (num % 2 != 0) { impares += num; } } printf("Hay %d positivos\n", contpos); printf("Hay %d negativos\n", contneg); printf("Hay %d ceros\n", contcer); printf("\n"); printf("Suma de positivos = %d\n", acupos); printf("Suma de negativos = %d\n", acuneg); printf("Suma de pares = %d\n", pares); printf("Suma de impares = %d\n", impares); getch();

}

Related Documents


More Documents from ""

Calentamiento Global.pdf
April 2020 16
Expo-legislacion.pptx
November 2019 9
December 2019 16
Acordes Y Cancion Help.docx
November 2019 25