Docsity

Programas C: Operaciones Matemáticas y Calculos, Ejercicios de Programación C

Toggle sidebar
bg1
#include <stdio.h>
int main()
{
int num;
float resultado;
printf("Ingrese el tiempo en horas por favor: ");
scanf("%d",&num);
resultado=num*3600;
printf("%d horas son %f en segundos", num,resultado);
return 0;
}
#include <stdio.h>
int main()
{
float nota1,nota2,nota3,R1;
printf("Ingrese la primer nota\n");
scanf("%f",&nota1);
printf("Ingrese la segunda nota\n");
scanf("%f",&nota2);
printf("Ingrese la tercera nota\n");
scanf("%f",&nota3);
R1=(nota1+nota2+nota3)/3;
if (R1>=3.0)
{
printf("Gano la materia\n");
}
if (R1>=2.5 && R1<3.0)
{
printf("Puede habilitar la materia\n");
}
if (R1<2.5)
{
printf("Perdio la materia\n");
}
return 0;
}
pf3
pf4

Vista previa parcial del texto

¡Descarga Programas C: Operaciones Matemáticas y Calculos y más Ejercicios en PDF de Programación C solo en Docsity!

int main() { int num; float resultado; printf("Ingrese el tiempo en horas por favor: "); scanf("%d",&num); resultado=num*3600; printf("%d horas son %f en segundos", num,resultado); return 0; } #include <stdio.h> int main() { float nota1,nota2,nota3,R1; printf("Ingrese la primer nota\n"); scanf("%f",&nota1); printf("Ingrese la segunda nota\n"); scanf("%f",&nota2); printf("Ingrese la tercera nota\n"); scanf("%f",&nota3); R1=(nota1+nota2+nota3)/3; if (R1>=3.0) { printf("Gano la materia\n"); } if (R1>=2.5 && R1<3.0) { printf("Puede habilitar la materia\n"); } if (R1<2.5) { printf("Perdio la materia\n"); } return 0;

int main() { float altura,peso,R1; printf("Ingrese su peso\n"); scanf("%f",&peso); printf("Ingrese su altura\n"); scanf("%f",&altura); R1=peso/(altura*altura); if (R1<18.5) { printf("Peso bajo"); } if (R1>18.5 && R1<24.9) { printf("Peso normal"); } if (R1>25 && R1<29.9 ) { printf("Sobre peso"); } if (R1>30) { printf("Obesidad"); } return 0;

int main() { float num1,num2; printf("Ingresa el primer numero\n"); scanf("%f",&num1); printf("Ingresa el segundo numero\n"); scanf("%f",&num2); if(num1>num2) { printf("%f es mayor a %f",num1,num2); } if(num1==num2) { printf("%f es igual a %f",num1,num2); } if(num1<num2) { printf("%0f es menor a %f",num1,num2); } return 0;