#pragma warning(disable : 4996)
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
int pause;
float Value1, Value2, Read1, Read2, Value3;
int numberOfErrors = 0;
//start by checking that 2 numbers was input - so the value of argc is 3
if (argc != 3)
{
numberOfErrors++;
printf("this programme should be called with two parameters\n");
}
if (argc == 3)
{
Read1 = sscanf(argv[1], "%d", &Value1);
printf(" The number entered was %f \n", Value1);
Read2 = sscanf(argv[2], "%d", &Value2);
printf(" The number entered was %f \n", Value2);
Value3 = Value1 + Value2;
printf("The sum of the two numbers is %f \n", Value3);
}
scanf("%d", &pause);//so we can read any messages
return (0);
}
18:40: warning: format ‘%d’ expects argument of type ‘int*’, but argument 3 has type ‘float*’
20:40: warning: format ‘%d’ expects argument of type ‘int*’, but argument 3 has type ‘float*’