Looping problem

Looping has been a problem for me in coding, this is is far as i get

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
  #include <iostream>
using namespace std;

int main()
{

	int N;
	int A;
	int F = 2;

	cout << " Enter value of N: ";
	cin >> N;

	if (N < 1){
		cout << " N value must be greater than 1 or this program will end " << endl;
	}


	else if ( N > 1){
		cout << " Value of F is: " << F << endl;
		A = N / F;
		cout << " The value of A is: " << A << endl;
	}
		
	

		
	system("pause");
	return 0;
}

This is the picture of the algorithm:

http://i59.tinypic.com/zswk13.jpg
so what is your question?
@shadowCODE after the part "is N > 1 if no then end", that is where i get stuck.
End the program with return 0;
From your algorithm, i dont see any else if
@shadowcode i was guessing on else if part, but not 100% sure. However, the question hints there is a loop.
Last edited on
Topic archived. No new replies allowed.