print out only the last number in Fibonacci series

I want to print out only the last number in the list... for example,,, if cin =12
I want cout= 377.... but the whole list is beeing printet out.
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, c, first = 1, second = 2, next;

	{cout << "Enter the number of terms of Fibonacci series you want" << endl;
	cin >> n;
	
	}

	for (c = 1; c < n; c++)
	{
		if (c <= 0)
			next = c;
		else

		{
			next = first + second;
			first = second;
			second = next;
		    
		}
		cout << second << endl;
	}

	return 0;
}
1
2
3
4
if(c ==n)
        {
            cout << second << endl;
        }
Move line 26 to 28.
tnx coder777;)
Topic archived. No new replies allowed.