- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

# C Program for n-th even number

Given a number N we have to find the N-th even number.

Even numbers are the numbers which are completely divided by 2 and their remainder is zero. Like 2, 4, 6, 8, 10,….

If we closely observe the list of even numbers we can also represent them as

2*1=2, 2*2=4, 2*3=6, 2*4=8,….2*N.

So, to solve the problem we can simply multiply the number N with 2, so the result will be the number which is divisible by 2, i.e. the even number.

## Example

Input: n = 4 Output: 8 The first 4 even numbers will be 2, 4, 6, 8, .. Input: n = 10 Output: 20

## Algorithm

START STEP 1-> DECLARE AND SET n AS 10 STEP 2-> PRINT n*2 NUMBER STOP

## Example

#include <stdio.h> int main(int argc, char const *argv[]){ int n = 10; printf("Nth even will be:%d", n*2); return 0; }

## Output

Nth even will be:20

- Related Questions & Answers
- C Program for n-th odd number
- C/C++ Program for the n-th Fibonacci number?
- Python Program for n-th Fibonacci number
- Java Program for n-th Fibonacci number
- N-th Tribonacci Number in C++
- N-th polite number in C++
- N-th Fibonacci number in Python Program
- C Program for N-th term of Geometric Progression series
- C Program for N-th term of Arithmetic Progression series
- C++ Program for Area Of Square after N-th fold
- n’th Pentagonal Number in C++
- N’th Smart Number in C++
- N-th root of a number in C++
- Python program for removing n-th character from a string?
- Java program for removing n-th character from a string

Advertisements