Write a program that prompts the user for a value for i and displays the e value, and this is all i have so far. I was told it's suppose to have two for loops but i'm not sure where and how to do it and i know my output is wrong as well, also the use of a for loop is important. #include <iostream> using namespace std; int main (){ double count; double i=1; double e; cout<<"What is the value for i?"; cin>>i; for(count=1;count<=i;count++){ e!=1/count; cout<<"The value of e is equal to :"<<e<<endl; } system ("pause"); return 0; }

Member Avatar
Member Avatar
+0 forum 1

I have been developing a simple java game, however I would like to add some Music to my game because it seems quite boring whenever you play it.

Member Avatar
Member Avatar
+0 forum 3

Good day folks, I hope you can help me with this one, I want to create a game. Can you tell me where to start, what softwares I need to study and what particular knowledge I should have. I'm not new to programming so do you think it will be hard if I want to learn this kind of thing?

Member Avatar
Member Avatar
+0 forum 8

Hello, I am look for some help with a query where the query changes on the basis of input parameters. Like $variable = 'abc'; $rs=mysql_query("SELECT * FROM table WHERE `column`='$variable'"); But what about a scenario where this variable is not assigned or is null or blank. In that case I'd like the query to ignore that column altogether and look into other parameters. I have been looking into it for a while but haven't found anything useful. I am not even sure if its possible. Any help or inputs will be appreciated! Thanks

Member Avatar
Member Avatar
+0 forum 1

write a programme to capture 3 numbers and determine the smallest and the largest.

Member Avatar
Member Avatar
+0 forum 8

Hello! After I compile and run my program a windows error message shows up, it doesn't give some specific information it's just a standard windows xp error that asks me to send report. It gives me the error because in my code I have some basic math like this: int e = a - b; int r = c - d; int w = e / r; Even if I make a simple console program with only those lines , it still gives me the error. I'm using the latest version of DEV C++ on windows XP.

Member Avatar
Member Avatar
+0 forum 2

hi everyone i create a simple program on dev++ but always a message error exist ps: im a debutante :/ plz help ! #include<stdio.h> #include <iostream> int main () {int a,b; __asm__ __volatile__ ("load a \n\t" "cmp b \n\t" "jb etq1 \n\t" "jmp etq2 \n\t" "etq1 load b \n\t" "etq2 store res \n\t" ); printf(" %d %d",a,b); return 0; }

Member Avatar
Member Avatar
+0 forum 1

Just wanted to know if we need to texture map the texture on the model with code or is it better to just import a model with textures already on him? (considering its even possible)

Member Avatar
Member Avatar
+0 forum 1

Hi, I was wondering is there a way where you can sell limited tickets. For example there are 55 seats in a bus and 55 people bought the tickets for the bus,the people who want to buy those tickets for the bus must wait for an hour. How would I implement this code in Dev c++ . Thank you.

Member Avatar
Member Avatar
+0 forum 5

hi, I am trying to make a variable equation solver using DEV-C++. I just need to know how to get C++ to solve an equation inputed by the user. So you input something like 1+1 and i need it to solve the problem and output the answer. heres an example: [CODE]#include<iostream> using namespace std; int main (char argc) { string n1; cin >> n1; // i input 1+1 int n2; solve n1 = n2; cout << n2 << endl; // it outputs 2 }[/CODE] thanks

Member Avatar
Member Avatar
+0 forum 75

hi, I have this code: [CODE]#include<iostream> #include<cstdio> #include<sstream> using namespace std; int main (char argc) {        float n1;        char operators;        string n2;        float n2_act;        float ans;        cin >> n1;        for(;;)        {                  cin >> operators;                  cin >> n2;                                                    …

Member Avatar
Member Avatar
+0 forum 19

Hi there, I am trying to compile devcpp project that contains one source file helloworld.cpp [CODE] #include <iostream> using namespace std; int main () { cout << "Hello World!"; system("PAUSE"); return 0; }[/CODE] I get this error: [ICODE] C:\Dev-Cpp\Makefile.win [Build Error] [helloworld.o] Error 1 [/ICODE] Compile log is as follows: [ICODE] Compiler: Default compiler Building Makefile: "C:\Dev-Cpp\Makefile.win" Executing make... make.exe -f "C:\Dev-Cpp\Makefile.win" all g++.exe -D__DEBUG__ -c helloworld.cpp -o helloworld.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include" -lglut32 -lglu32 -lopengl32 -lwinmm -lgdi32 -g3 g++.exe: helloworld.cpp: No such file or directory make.exe: *** [helloworld.o] Error 1 Execution terminated [/ICODE] Does anyone know what is …

Member Avatar
+0 forum 0

hi, i am trying to make a weight watchers program and heres my code: [CODE]#include<iostream> #include<fstream> #include<conio.h> #include<cstdio> #include<windows.h> using namespace std; int main (char argc) { for(;;) { system("cls"); ifstream r; r.open("cdaily.txt"); double r1; r >> r1; r.close(); ifstream r2; r2.open("cweekly.txt"); double r3; r2 >> r3; r2.close(); cout << "You have "<<r1<<" daily points left for the day." << endl; cout << "You have "<<r3<<" weekly points left for the week." << endl; cout << "1: Eat new food (from daily) \n2: Eat new food (from weekly) \n3: Reset daily points (new day) \n4: Reset weekly points (new week) …

Member Avatar
Member Avatar
+0 forum 1

Hi, I am trying to make a one octave piano. heres my code: [CODE]#include<windows.h> #include<mmsystem.h> #include<stdlib.h> /* Declare Windows procedure */ LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM); /* Make the class name into a global variable */ char szClassName[ ] = "WindowsApp"; int WINAPI WinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPSTR lpszArgument, int nFunsterStil) { HWND hwnd; /* This is the handle for our window */ MSG messages; /* Here messages to the application are saved */ WNDCLASSEX wincl; /* Data structure for the windowclass */ /* The Window structure */ wincl.hInstance = hThisInstance; wincl.lpszClassName = szClassName; wincl.lpfnWndProc = WindowProcedure; …

Member Avatar
Member Avatar
+0 forum 5

hi, i am writing a program for my dad. I want it to keep the mouse in x=500 y=500 while waiting for input. So its asking for the password and if you try to move the mouse, it'll put the mouse back in x=500 and y=500 and have keep looping that until the correct password is inputed. Any solutions?

Member Avatar
Member Avatar
+0 forum 22

Hi, i am trying to make a BMI calulator and here is my code: [CODE]#include<iostream> #include<sstream> #include<fstream.h> using namespace std; int main (char argc) { double ff1; double ii1; double ww1; for(;;) { system("cls"); cout << "Enter feet." << endl; string f1; cin >> f1; stringstream(f1) >> ff1; if(ff1 >! -999999999) // I wanted to use if(stringstream(f1).fail()) but that didnt work { if(f1 == "u") { fstream feet; feet.open("feet.txt"); feet >> ff1; } if(f1 == "uc") { fstream feet1; feet1.open("feet.txt"); cout << "Enter new default feet." << endl; double f2; cin >> f2; feet1 << f2; ff1 = f2; } …

Member Avatar
Member Avatar
+0 forum 8

Hi, I am using DEV-C++ and i am wondering how to declare variables in a windows project. I am trying to make a calculator and i need it to declare a variable a certain number when you press a button. I also need it to declare a char after you press another button. Also, i need it to be able to output what the variable equals. Thanks

Member Avatar
Member Avatar
+0 forum 4

hi, i am just wondering how to open a picture of a normal format. I know that you cant do it in the console. And i am using the compiler DEV-C++. Thanks

Member Avatar
Member Avatar
+0 forum 2

hi, i am trying to make a calculator and i have this code [CODE]#include<iostream> #include<sstream> using namespace std; int main (char argc) { int l = 1; for(l = l; l > 0; l--) { int q = -2; string n1 = "1+5"; int n; int e; stringstream(n1[q=q+2]) >> n; stringstream(n1[q=q+2]) >> e; cout << n + e << endl; } system("pause"); } [/CODE] this is just a test program i use to figure out hard problems with the original one. so if i dont use stringstream, the answer doesnt come out right. any solutions?

Member Avatar
Member Avatar
+0 forum 3

hi, i am writing a program that keeps track of the money in my debit card account. i need the program to be able to pull out a value (such as 1.56356) from a text file, round it to the nearest hundredth, and put it back into the file. any solutions?

Member Avatar
Member Avatar
+0 forum 4

hi, i have this code [CODE]#include <fstream.h> #include<iostream> using namespace std; int main (char argc) { for(;;) { fstream file; file.open("file.txt"); cout << "Enter new high score." << endl; double n2; cin >> n2; double n1; file >> n1; if(n1 > n2) { cout << "You didn't beat the high score of "<<n1<<"."<< endl; } if(n1 < n2) { cout << "You beat the high score of "<<n1<<"."<< endl; file << n1 << endl; } if(n1 == n2) { cout << "Your score is the same as the high score" << endl; } file.close(); } } [/CODE] and for some …

Member Avatar
Member Avatar
+0 forum 6

hi, how would you get a certain part of code to run while the program is waiting for the input? [CODE]string in; int n1 = 0; n1++ // get this part of code to loop while the program is waiting for the input cin >> in[/CODE] thanks.

Member Avatar
Member Avatar
+0 forum 18

hi, i am using DEV-C++ and i have two problems with this code: [CODE]#include<iostream> #include<string> #include<sstream> using namespace std; int main (char argc) { string n1; getline(cin,n1); int len; len = n1.length(); int len1 = -2; int len2 = -1; for(int t = len; t>0; t--) { len1 = len1 + 2; len2 = len2 + 2; cout << "number "<< n1[len1] << endl; cout << "operator "<< n1[len2] << endl; } system("pause"); } [/CODE] i want the output to never end with an operator and whenever i enter a number larger than 9, it ends with an operator. my …

Member Avatar
Member Avatar
+0 forum 9

hi, i have this code: [CODE]#include <iostream> #include <fstream> #include<cstdio> #include<cstdlib> using namespace std; int main (char argc) { for(;;) { fstream myfile; myfile.open("example.txt"); cout << "1: Write" << endl; cout << "2: Read" << endl; int n1; cin >> n1; if(n1 == 1) { string n2; getline(cin,n2); myfile << n2 << endl; } if(n1 == 2) { string n3; getline(myfile,n3); cout << n3 << endl; } myfile.close(); } } [/CODE] when i run it, i want to write to the file but when i press 1, the program just goes back to the main menu. any solutions?

Member Avatar
Member Avatar
+0 forum 7

i am working on an encoder nad i have developed a way to encode my message in terms of (x,y) coordinates..but i have to put these locations on a world map to strengthen my encoder.... im using dev c++ 4.9.9.2 and need a gui base coding for my c++ program and the mapping part..please help.

Member Avatar
Member Avatar
+0 forum 2

I'm trying to make a program where you enter the number you want to find primes up to which then lists all the primes up to that number... But I enter 100 then it just sits there... Here's my code so far: [CODE]#include <iostream> #include <cmath> int prime(int); int main() { using namespace std; int upto; int current = 3; cout << "Find primes up to: "; cin >> upto; while(current < upto){ cout << prime(current) << endl; } system("pause"); return 0; } int prime(int p) { int test = p - 1; while(test > -1){ if(test == 0){ return …

Member Avatar
Member Avatar
+0 forum 11

Not sure if this is the right place for this, but here we go. Basically I would like to get back into building websites, but I have no idea which dev tools to use. I haven't built a website for about 5 years ago and then I was using Microsoft front page (mostly because it came with my computer). I'm not sure if this was any good but I got on with it fine. Basically, I would like some advice on where to start and what programs to buy (or better, download for free). I know some HTML and my …

Member Avatar
Member Avatar
+0 forum 22

so for my computing project we have just started to work with using input and output of text files, the tutorial my teacher gave said to include these libraries, which i did [CODE]#inclue <fstream> #include <iomanip>[/CODE] and explains how to use [CODE] ifstream fin; //fin is my file input variable ofstream fout; //fout is my file output variable[/CODE] the problem is dev c++ doesnt seem to recognize this, my teacher works with xcode so is that whats messing this up? or does my version need an update or something? or does dev do this a different way than xcode? sorry …

Member Avatar
Member Avatar
+0 forum 2

Hey guys, it is possible to program a speech recognition in C++ without the Microsoft Speech SDK?

Member Avatar
Member Avatar
+0 forum 1

The End.