PROGRAM PSEUDOCOD
citeste a, b
daca a-b == 1 sau a-b==-1 atunci
scrie "Sunt consecutive"
altfel scrie "Nu sunt consecutive"
PROGRAM C++
#include <iostream>
using namespace std;
int main(){
int a,b;
if(a-b==1 || a-b==-1) cout << "Sunt consecutive";
else cout << "Nu sunt consecutive"
}