what does \n and %d mean?
Here, in C programming \n is an escape character that helps to create a new line whereas %d is a format specifier that allows to specify only Integer values.
WAP to print the following series:
2, 4, 6, 8 up to 10th term.
The following is a program to print the following series:
2, 4, 6, 8 up to 10th term.
In JAVASCRIPT
let a = []
const b = 10
for (let i=2; i <= b; i+=2) {
a.push(i)
}
console.log(a)
#include<stdio.h>
#include<conio.h>
#include<string.h>
int main() {
int i, number, num1, num2=0;
char str1[50];
num1 = number;
for(i=2; i<=20; i+=2) {
printf("%d", i);
printf(", ");
}
return 0;
}