#include <stdio.h>
#include <math.h>
int main()
{
double numero;
//Pedir al usuario que ingrese un número real
printf("Ingrese un número real: ");
scanf("%lf", &numero);
//Verificar si el número está dentro del intervalo <-10, 20]
if (numero >-10 && numero <=20)
{
printf("El número %.2lf pertenece al intervalo <-10, 20]\n", numero);
//Calculamos y mostramos el seno del número
double seno = sin(numero);
printf("El seno de %.2lf es %.4lf\n", numero, seno);
}
else
{
printf("El número %.2lf no pertenece al intervalo <-10, 20]\n", numero);
//Calculamos y mostramos la tangente del número
double tangente = tan(numero);
printf("La tangente de %.2lf es: %.4lf\n", numero, tangente);
}
return 0;
}
Antonio Adolfo Samuel Cueva Fuentes17:56
Escriba un programa en C que pida un número entero y en caso sea múltiplo de 4 a excepción del 500, se mostrará el mensaje “Número ALPHA” caso contrario se mostrará el mensaje “Número BETA”.
#include <stdio.h>
int main() {
int numero;
//Pedimos que el usuario ingrese un número entero
printf("Ingresa un número entero: ");
scanf("%d", &numero);
//Verificamos si el número es múltiplo de 4 Y diferente de 500
if (numero % 4 == 0 && numero != 500) {
printf("Número ALPHA\n");
} else {
printf("Número BETA\n");
}
return 0;
}
Lab 8, Working With structs
Programmer: Maiar Khattab
Editor(s) used: Code Blocks 13.12
Compiler(s) used: Code Blocks 13.12
File: prog.cpp
Complied: Sep 12 2024 at 19:01:53
noon is 12:0:0
midnight is 0:0:0
supper is 6:0:0
bedtime is 11:30:0
��� �lY= is 1236044760:32766:-1941312000