Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- int main (){
- int N, X, I, CP, CD, PP, UP, PPP, UPP;
- CP=CD=0;
- for (X=1;X<=7;X++){
- cout<<"Digite un numero: "; cin>>N;
- if (N%2==0){
- CP++;
- if (CP==1){
- PP=N;
- PPP=X;}
- }
- for (I=1;I<=N;I++){
- if (N%I==0)
- CD++;}
- if (CD<=2){
- UP=N;
- UPP=X;}
- }
- cout<<"El primer numero par es: "<< PP << " con la ubicacion numero: " << PPP <<endl;
- cout<<"El ultimo numero primo es: "<< UP << " con la ubicacion numero: " << UPP <<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement