a = 10, c = 27 ?, dunno what d is
Type: Posts; User: xbusterx
a = 10, c = 27 ?, dunno what d is
My program isn't working right now and I don't know what to do. What is the output can someone help me?
a= 5 , b = 6
a = (b++) + 3;
c = 2*a + (++b);
d = 2 * (++c) - (a++);
.....
Well I've read the notes in class and I don't have the book for the class since it's optional it was over $200 and I couldn't afford it sorry some people aren't rich.
That's exactly what I've been trying to do, but how do I read it from the stream I tried, but it didn't work!
By open I mean I want to display what is in the file on the terminal screen. That's what I mean, but's not working.
So I opened it and closed it?
Why did it close?
the stuff that's inside the file. What do u think?
Because I don't see it......
#include <iostream>
#include <string>
#include <fstream>
using namespace std;
// Function prototypes
Well I'm trying to open the file, but it's not opening.
Well that isn't the problem I do it this way.
I'm making a program where the user type in a file name and opens the file.
This is what I did, but it's not working.
What do I do?
Plz help thx.
i'm using emacs.
that doesn't do any this.
Ya I'm asking you what would u do?
#include <iostream>
using namespace std;
int main ()
{
int j;
int t;
int p;
int sum =0;
int n;
cout << enter number;
cin >> n;
for (int i = 1 ; i < n ; i++ )
if ( n % i == 0 )
sum += i
Ok so can I do this?
int sum =0;
int n;
cout << enter number;
cin >> n;
Ya don't I don't know how to do that here since i is changing.
um like sum += num ?
exactly you're right , BUT how do I add them? that's why I need to exact the divisors to add them.
No that's not what I mean. IF ( n % i = 0 ) that means i is a divisor, but how do I extract the divisors so I can add them? sorry I'm new.
ok what if I say this:
int n;
cout << enter number;
cin >> n;
for (int i = 1 ; i < n ; i++ )
if ( n % i = 0 )