Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

write a program that add up all the odd integer bettuen 20 and 56 and print the result.

0 votes
asked Apr 28, 2018 by almshet

1 Answer

0 votes
answered Apr 29, 2018 by Aditya Rao P
#include <stdio.h>

int main(void){

int sum=0;

for(int i=20;i<56;i++){

if(i%2==1){

sum=sum+i;}}

printf("sum=%d",sum);

}
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...