Hey it compiles but doesnt do what i want it do...can you help me out?

hey i have this program that adds and finds the square root it adds but it doent find the square root.Can you tell me why?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#include "stdafx.h"
#include <iostream>
#include <cmath>

using namespace std;

int Findarea(unsigned length,unsigned width);
float Findsqrt(float inputone,float inputtwo);

int main()
{
	unsigned lengthofhouse;
	unsigned widthofhouse;
	unsigned areaofhouse;
	float oneinput;
	float secoundinput;
	float total;

	

	cout << "What is the length of your house?";
	cin >> lengthofhouse;

	cout << "What is the width?";
	cin >> widthofhouse;

	areaofhouse = Findarea(lengthofhouse,widthofhouse);





	cout << "the area of ur house is :" << areaofhouse;

	cout << "_________________________________________________________";

	cout << "input numbers for square root\n";

	cout << ":";
	cin >> oneinput;

	cout << ":";
	cin >> secoundinput;

	cout << "The squareroot is:" << total;

	total = Findsqrt(oneinput,secoundinput);

	cin.sync ();
	cin.get();
	return 0;


}
int Findarea(unsigned length,unsigned width)
{
	int temp;
	temp = length + width;
	return temp;
}

float Findsqrt(float inputone,float inputtwo)
{
	float temp;
	temp = sqrt(inputone + inputtwo);
	return temp;
}


Thanks.
line 27 can be changed to for example: (use functions if necessary. Note area is height*width
areaofhouse = lengthofhouse * widthofhouse;

Yes, function Findsqrt(float, float) finds squareroot for SUM for passing arguments.
For example if you give parameters (1,3) you would be givin result of:
sqrt(1+3)
=sqrt(4)
=2...
and if you give (9,16)?
sqrt(9+16)
=sqrt(25)
=5

See the even 1 error?
heres my compiler message it compiles though.

'fuction pro num 2.exe': Loaded 'C:\Users\jaffar\Documents\Visual Studio 2010\Projects\fuction pro num 2\Debug\fuction pro num 2.exe', Symbols loaded.
'fuction pro num 2.exe': Loaded 'C:\Windows\System32\ntdll.dll', Cannot find or open the PDB file
'fuction pro num 2.exe': Loaded 'C:\Windows\System32\mscoree.dll', Cannot find or open the PDB file
'fuction pro num 2.exe': Loaded 'C:\Windows\System32\kernel32.dll', Cannot find or open the PDB file
'fuction pro num 2.exe': Loaded 'C:\Windows\System32\KernelBase.dll', Cannot find or open the PDB file
'fuction pro num 2.exe': Loaded 'C:\Windows\System32\msvcr100d.dll', Symbols loaded.
'fuction pro num 2.exe': Loaded 'C:\Windows\System32\msvcp100d.dll', Symbols loaded.
'fuction pro num 2.exe': Loaded 'C:\Windows\System32\advapi32.dll', Cannot find or open the PDB file
'fuction pro num 2.exe': Loaded 'C:\Windows\System32\msvcrt.dll', Cannot find or open the PDB file
'fuction pro num 2.exe': Loaded 'C:\Windows\System32\sechost.dll', Cannot find or open the PDB file
'fuction pro num 2.exe': Loaded 'C:\Windows\System32\rpcrt4.dll', Cannot find or open the PDB file
'fuction pro num 2.exe': Loaded 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscoreei.dll', Cannot find or open the PDB file
'fuction pro num 2.exe': Loaded 'C:\Windows\System32\shlwapi.dll', Cannot find or open the PDB file
'fuction pro num 2.exe': Loaded 'C:\Windows\System32\gdi32.dll', Cannot find or open the PDB file
'fuction pro num 2.exe': Loaded 'C:\Windows\System32\user32.dll', Cannot find or open the PDB file
'fuction pro num 2.exe': Loaded 'C:\Windows\System32\lpk.dll', Cannot find or open the PDB file
'fuction pro num 2.exe': Loaded 'C:\Windows\System32\usp10.dll', Cannot find or open the PDB file
'fuction pro num 2.exe': Loaded 'C:\Windows\System32\imm32.dll', Cannot find or open the PDB file
'fuction pro num 2.exe': Loaded 'C:\Windows\System32\msctf.dll', Cannot find or open the PDB file
'fuction pro num 2.exe': Loaded 'C:\Program Files\Windows Searchqu Toolbar\Datamngr\datamngr.dll', Cannot find or open the PDB file
'fuction pro num 2.exe': Loaded 'C:\Windows\System32\wtsapi32.dll', Cannot find or open the PDB file
'fuction pro num 2.exe': Loaded 'C:\Windows\System32\dbghelp.dll', Cannot find or open the PDB file
'fuction pro num 2.exe': Unloaded 'C:\Program Files\Windows Searchqu Toolbar\Datamngr\datamngr.dll'
'fuction pro num 2.exe': Unloaded 'C:\Windows\System32\dbghelp.dll'
'fuction pro num 2.exe': Unloaded 'C:\Windows\System32\wtsapi32.dll'
'fuction pro num 2.exe': Loaded 'C:\Program Files\Windows Searchqu Toolbar\Datamngr\IEBHO.dll', Cannot find or open the PDB file
'fuction pro num 2.exe': Loaded 'C:\Windows\System32\dbghelp.dll', Cannot find or open the PDB file
'fuction pro num 2.exe': Unloaded 'C:\Program Files\Windows Searchqu Toolbar\Datamngr\IEBHO.dll'
'fuction pro num 2.exe': Unloaded 'C:\Windows\System32\dbghelp.dll'
'fuction pro num 2.exe': Loaded 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll', Cannot find or open the PDB file
'fuction pro num 2.exe': Loaded 'C:\Windows\System32\msvcr100_clr0400.dll', Cannot find or open the PDB file
'fuction pro num 2.exe': Loaded 'C:\Windows\assembly\NativeImages_v4.0.30319_32\mscorlib\93e7df09dacd5fef442cc22d28efec83\mscorlib.ni.dll', Cannot find or open the PDB file
'fuction pro num 2.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll'
'fuction pro num 2.exe': Loaded 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\nlssorting.dll', Cannot find or open the PDB file
'fuction pro num 2.exe': Loaded 'C:\Windows\System32\ole32.dll', Cannot find or open the PDB file
'fuction pro num 2.exe': Loaded 'C:\Windows\System32\cryptbase.dll', Cannot find or open the PDB file
'fuction pro num 2.exe' (Managed (v4.0.30319)): Loaded 'C:\Users\jaffar\documents\visual studio 2010\Projects\fuction pro num 2\Debug\fuction pro num 2.exe', Symbols loaded.
'fuction pro num 2.exe': Loaded 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\clrjit.dll', Cannot find or open the PDB file
'fuction pro num 2.exe': Loaded 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\diasymreader.dll', Cannot find or open the PDB file
'fuction pro num 2.exe': Loaded 'C:\Windows\assembly\NativeImages_v4.0.30319_32\System\ffc825af968e2afbdd0d894b475331f3\System.ni.dll', Cannot find or open the PDB file
'fuction pro num 2.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll'
The thread 'Win32 Thread' (0xcc8) has exited with code -1073741749 (0xc000004b).
The thread 'Win32 Thread' (0xd40) has exited with code -1073741510 (0xc000013a).
The thread 'Win32 Thread' (0x290) has exited with code -1073741510 (0xc000013a).
The thread 'Main Thread' (0xd34) has exited with code -1073741510 (0xc000013a).
The thread 'Win32 Thread' (0x3d0) has exited with code -1073741510 (0xc000013a).
The program '[1120] fuction pro num 2.exe: Managed (v4.0.30319)' has exited with code -1073741510 (0xc000013a).
The program '[1120] fuction pro num 2.exe: Native' has exited with code -1073741510 (0xc000013a).

original code compiles fine on my LINUX console AFTER removing line:
#include "stdafx.h"
and typing (to console of course):
g++ 1.cpp


As i looked compiler errors i saw you are using Window$. As far i see PART of the code given by you it is OK.
Last edited on
Topic archived. No new replies allowed.