473,408 Members | 2,839 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,408 software developers and data experts.

plz help - for repetition...

if i wanna do some programming

lets say... i hv

a[n]=a[n-1]+3*a[n-1]*(1.0^-10)

how to generate the answer if a[0]=(1.0^-10)

ive done but wen i compared the answer using calculator..the answer is wierd..they r not same..
i used "for" repetition..

thank you
Mar 10 '09 #1
3 1344
JosAH
11,448 Expert 8TB
@anizatie
If I rewrite that recurrent expression I get:

a[n] = (1+3*1^-10)*a[n-1]

If I solve this homogenous expression I get:

a[n] = (1+3*1^-10)^n*a[0]

Does this help a bit?

kind regards,

Jos
Mar 10 '09 #2
@JosAH
Thank you... Jos.. ive got the solution just now..
instead of putting 1*10^-10, we should write 1.0e-10 in c++...
Mar 11 '09 #3
JosAH
11,448 Expert 8TB
@anizatie
Ah, yes, but that's just a notational issue, not an algebraic, nor a numerical issue. the single letter 'e' or 'E' reads 'times ten raised to the power of' and a lot of programming languages use that notation. The '^' character is used for other operations.

kind regards,

Jos
Mar 11 '09 #4

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

Similar topics

10
by: Brad Kartchner | last post by:
In a project I am working on, I have found myself with two classes that reference each other. For example: firstclass.h: { class FirstClass { function (SecondClass* Pointer); } }
1
by: Chris Gamache | last post by:
For my particular case, word repetition shouldn't be relevant in determining the rank of a document. If I strip() the vector, I loose what relevance proximity and weight add to the rank. It seems...
2
by: Billy_270 | last post by:
Hi! I have a text "*.jpg;*.bmp;*.png" and I'd like to get "*.jpg", "*.bmp" and "*.png". I've tried the pattern "^(?:(\*\..+);)*(\*\..+)$", but it doen't work because it returns "*.jpg;*.bmp" and...
2
by: Bart | last post by:
Dear all, I have a problem that I cannot understand the reason of. My code is private void ButtDetl_Click(object sender, System.EventArgs e) { // give an information of the sender int...
6
by: udhas | last post by:
Write a program that prints the following diamond shape. You may use output statements that print a single asterisk (*), a single space or a single carriage return. Maximize your use of repetition...
4
by: mj.clift | last post by:
Hi All, I need to be able to choose a random string from an array. That is easy enough, but I want to restrict the repetition of that string until one or two other choices have been made. So the...
4
by: XpatienceX | last post by:
Hi, Can someone help me with this assignment, I am confused of what is needed to be done here. I am suposed to design a program that models a worm's behavior in the following scenario: A...
5
by: NATHAN1511 | last post by:
How To Write A Program By Using Repetition Structure As Show Below: 1 12 123 1234 12345
15
by: Beany | last post by:
Hi All, i need help with the following: i need to write a simple program that asks the user to input a number (minimum of 3 digits), which i seperate into individual digits and print the 1st...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.