Lets say I want to run x.c from a.c
here a.c
Code:
#include<stdio.h>
#include<stdlib.h>
int main()
{
char x[5];
system("x");
return 0;
}
x.c
Code:
#include<stdio.h>
#include<stdlib.h>
int main()
{
int score;
printf("please enter marks:");
scanf("%d",&score);
if(score>60)
{
printf("pass");
}
else
{
printf("fail");
}
return 0;
}
So both files under the same directory.
And if I compile them it turns into a.out
When I execute the command ./a.out here is what I get in the terminal
PHP Code:
sh: 1: x: not found