pablosotol

Guia Programacion 1 - Ejercicio 15

Mar 26th, 2015
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.30 KB | None | 0 0
  1. #include<stdio.h>
  2. int main(){
  3.     int n;
  4.     printf("\nIngrese un numero positivo: ");
  5.     scanf("%d",&n);
  6.     if(n<0){
  7.     printf("\nEl numero es negativo, debe ser positivo");
  8. }
  9.     if(n%2==1)
  10.     printf("\nEl numero ingresado es primo");
  11.     else
  12.     printf("\nEl numero no es primo");
  13.  
  14. }
Advertisement
Add Comment
Please, Sign In to add comment