This is the old picture, not as same as the code below.
#include<stdio.h>
#include<conio.h>
#include <math.h>
int main(void)
{
int num, lower, upper;
double squareroot;
int square;
int cube;
// input value
do
{
printf("the lower value limit is ");
scanf_s("%d", &lower);
} while (lower < 0 || lower > 50);
do
{
printf("the upper value limit is ");
scanf_s("%d", &upper);
} while (upper < 0 || upper > 50);
// the formular to find the squareroot, square, cube
squareroot = sqrt(num);
square = num * num;
cube = num * num * num;
printf("*base number* || *square root* || *square* || *cube*\n");
printf("*%d* || *%f* || *%ld* || *%ld*\n",
num, squareroot, square, cube);
return 0;
The picture says The system cannot find the file specified, and when I try to rebuild the solution, they show me another program issue. For another program, I was making some changes on there, but when I run it, the thing I changed didn't has a change
CodePudding user response:
The <conio.h>
is not present in latest compilers. Your program would throw an error. The <conio.h>
was discontinued. It was used in MS-DOS compilers long back. Please do add a }
at the end of the void main()
function.
CodePudding user response:
Judging from the comments you posted below the question, the reason for the problem was the following:
You were ignoring the content of the "Output" window, which states that building the executable file has failed.
The "Output" window shows you all the error messages generated by the compiler. You should always read these error messages exactly, and you should not attempt to run the program if compiling failed. Otherwise you may run an old version of the program or get an error message that it cannot find the executable file.