C Program To Find Sum of All Even Numbers From 1 To N, using For loop

preview_player
Показать описание

Lets write a C program to find sum of all the even numbers from 1 to N, using for loop.

Even Number: An even number is an integer that is exactly divisible by 2.

For Example: 8 % 2 == 0. When we divide 8 by 2, it give a reminder of 0. So number 8 is an even number.

If user enters num = 5. Even numbers between 1 to 5 are 2, 4. So we add 2 and 4. i.e., 2 + 4 = 6. We display 6 to the console window as result.

C Programming Interview / Viva Q&A List

C Programming: Beginner To Advance To Expert
Рекомендации по теме
Комментарии
Автор

I am just starting with C programming. In this example I had put the last printf in wrong place, now it works. thanks a lot

dongaboo
Автор

write a program to read 20 numbers.Then display the following
a) The sum of ALL numbers
b) The average of All numbers
c) The COUNT of all EVEN numbers
d) The SUM of all EVEN numbers
e) The COUNT of all ODD numbers
f) The SUM of all ODD numbers

Urbano
Автор

at 0:34
background me sex ki noise aa rahi hai😂😂😂😂😂

AyushSingh-hcpj
Автор

Function ke through bata do sir plz 🙏
Paper aane wala mujhe mil na raha hai kahi

sheetalsingh
Автор

Yar Hindi Urdu me bolo is angrez Banay ho

Salman_