Tuesday, September 24, 2019

//take input 5 numbers and sum of all even number between them

C program : Take 5 numbes input and sum of all between number between them

#include <stdio.h>
int main() {
    int total=0;
int i, numbers[5];
printf("input the first number\n: ");
    scanf("%d", &numbers[0]);
    printf("input the second number\n: ");
    scanf("%d", &numbers[1]);
    printf("input the third number\n: ");
    scanf("%d", &numbers[2]);
printf("input the fourth number\n: ");
    scanf("%d", &numbers[3]);
    printf("input the fifth number\n: ");
    scanf("%d", &numbers[4]);
for(i = 0; i < 5; i++) {
if((numbers[i]%2) != 1)
{
   total += numbers[i];
}
    }
    printf("Sum of all even values: %d", total);
return 0;
}


0 Comments:

Post a Comment

Categories

About Me

My photo
I am Md Fakhrul Islam. I am a student of EEE of Daffodil International University I am expert in SEO and Graphic designing.

Contact Form

Name

Email *

Message *

Popular Posts