#include<iostream>
using namespace std;
int main()
{
    int i,sum=0;
    for(i=0;i<=15;i++)
    {
        if(i%2 !=0)
        {
            sum=sum+i;
            cout<<"the number is :"<<i<<endl;
        }
    }
    cout<<"the sum of odd number is: "<<sum<<endl;
    return 0;
}

Embed on website

To embed this program on your website, copy the following code and paste it into your website's HTML: