473,396 Members | 1,917 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

it says-missing statment on line 10, why?

Expand|Select|Wrap|Line Numbers
  1. #include <iostream.h>;
  2. #include <stdlib.h>;
  3. #include <math.h>;
  4.  
  5. void main ()
  6. {
  7.  
  8.  float i , A1(1),  asmpv1(0.00) , asmpv2(0.00) , asmpv3(0.00) , asmpv4(0.00) , sum(1);
  9.  asmpv1 = (1 ^ 2)/4.00);
  10.  cout << " For n=1 the asumption value is " << asmpv1 << endl;
  11.  cout << " A1 = " << A1 << endl;
  12.  cout << " The diff is " << abs(asmpv1-A1) << endl;
  13.  
  14.  
  15.   for ( i = 2 ; i<=10 ; i++ )
  16.               sum += sqrt(sum);
  17.   asmpv2 = ((10 ^ 2)/4);
  18.   cout << " For  n=10 the asumption value is "  << asmpv2 << endl;
  19.   cout << " A10 = " << sum << endl;
  20.   cout << " The diff is " << abs(asmpv2-sum) << endl;
  21.  
  22.  
  23.   for ( i = 11 ; i<=100 ; i++ )
  24.               sum += sqrt(sum);
  25.   asmpv3 = ((100 ^ 2)/4);
  26.   cout << " For  n=100 the asumption value is "  << asmpv3 << endl;
  27.   cout << " A100 = " << sum << endl;
  28.   cout << " The diff is " << abs(asmpv3-sum) << endl;
  29.  
  30.  
  31.   for ( i = 101 ; i<=1000 ; i++ )
  32.               sum += sqrt(sum);
  33.   asmpv4 = ((1000 ^ 2)/4);
  34.   cout << " For  n=1000 the asumption value is "  << asmpv4 << endl;
  35.   cout << " A1000 = " << sum << endl;
  36.   cout << " The diff is " << abs(asmpv4-sum) << endl;
  37.  
  38.  
  39.   system ("pause");
  40.  }
Nov 20 '11 #1
1 1337
weaknessforcats
9,208 Expert Mod 8TB
Check your C++ book for the ^ operator.
Nov 21 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Cordula's Web | last post by:
Hello, here's a strange bug (?) I've came across (using Python 2.2): # loop_1 for line in file: if some_condition(line): break do_something() # loop_2
8
by: 73blazer | last post by:
Hello, I'm looking for a way to make some of my insert templates more readable by placing comments in between the values. I cannot seem to find a way to do this with DB2, is there a way? I'm...
1
by: Me, Myself, and I | last post by:
First off, i apologize if my terminology is off... I am currently in a project that is basically a front-end to a database. In coding this, I am taking into account that it has the *potential*...
5
by: vsteshenko | last post by:
Hello, This is my second post to the any usernet group and the first one was posted to the wrong one. I am currently working on creating an order form for sales associates at my work to be used...
4
by: huzzaa | last post by:
I am using a switch statement that will decide from a random number what message to display. I want the random number to be between 0 and 100 and then if the number is say between 1 and 10 to...
1
by: zeebiggie | last post by:
Good morning I have a form with the controls in the insert statment below. table1 has an Auto increment primary key hence is omitted in the insert statment and form. Am getting the error It didnt...
4
by: tshad | last post by:
I have a program that is reading a .csv file into a dataset and works fine except that it is dropping the first line. I assume that is because it is dropping the header. The problem is the first...
3
by: shatterah | last post by:
I am attempting to actively add multiple lines of text to the bottom of the page based on if conditions. However I am having trouble with breaking each message into its own line, making the text red...
8
by: =?Utf-8?B?a2FyaW0=?= | last post by:
Hello All, I have this simple if statment, but under the (IF) there is that blue line for errors. what is wrong with it? Private Sub Button27_Click(ByVal sender As System.Object, ByVal e As...
1
by: smartic | last post by:
I need to use this string "preg_match('$pattern','$value')" to return boolean value in if statment how can i do that i used eval function put it give me this error (Parse error: syntax error,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.