problem in testing a c code in terminal
Hello
I made a directory,I put in it two files exo1.h and exo1.c
but when I want to test the code by typing (./exo1) in terminal I received this message :-
(bash: ./exo1: No such file or directory)
I put this code in exo1.h :-
----------------------------------------
#ifndef exo1
#define exo1
// Print all divisor of an integer
int allDivisors(int n);
#endif
----------------------------------------
and this code in exo1.c :-
--------------------------------------------------
#include "exo1.h"
#include "stdlib.h"
#include "stdio.h"
/**
compute and print all divisors
@param n: the integer
*/
int allDivisors(int n){
int i;
for(i = 2;i<n/2+1;i++)
if(n%i==0)
printf("%d\n",i);
}
int main(){
int nb=-1;
do {
printf("A positive integer please :");
scanf("%d",&nb);
}while(nb<=0);
printf("The all divisors for %d is: \n",nb);
allDivisors(nb);
}
------------------------------------------------------------------
|