//Developed By Muhammad Rakib Hasan 2279
//Addition value of Even numbers in given range
#include<stdio.h>
int main(){
int s,e,sum=0;
printf("Enter a starting value: ");
scanf("%d",&s);
printf("Enter a ending value: ");
scanf("%d",&e);
printf("Addition value of Even numbers in given range are: \n\n");
for(s;s<e;s++){
if(s%2==0){
sum=sum+s;
}
}
printf("%d",sum);
return 0;
}
Result :
//Addition value of Even numbers in given range
#include<stdio.h>
int main(){
int s,e,sum=0;
printf("Enter a starting value: ");
scanf("%d",&s);
printf("Enter a ending value: ");
scanf("%d",&e);
printf("Addition value of Even numbers in given range are: \n\n");
for(s;s<e;s++){
if(s%2==0){
sum=sum+s;
}
}
printf("%d",sum);
return 0;
}
Result :
কোন মন্তব্য নেই:
একটি মন্তব্য পোস্ট করুন