// Online C compiler to run C program online
#include <stdio.h>
int i, j, N;
int T[20];
int main() {
printf("Entrer la taille du tableau :");
scanf("%d",&N);
for(i=0; i<N; i++){
printf("Entrer l'element T[%d] du tableau :",i);
scanf("%d",&T[i]);
}
for(i=0; i<N-1; i++){
if(T[i+1] != T[i]+1){
printf("Le tableau ne contient pas des elements consecutifs.");
return 0;
}
}
printf("Le tableau a des valeurs consecutifs.");
return 0;
}
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter