I am just trying to run a program that add two numbers and outputs as a float.
For example: $Me ./mc + 1 2.3
should produce $Me 3.3 or 3.3000
Here is what I have:
#include <stdio.h>
int main( int ac, char* args[] )
{
float sum=0;
if ((strcmp(args[1],"+")) == 0)
{
sum=atof(args[2])+atof(args[3]);
printf("%f\n", sum);
}
else
printf("exit");
return 0;
}