I want to print out dividends that exist in a range and their sum. let's say I give a range between 15 and 85 and print numbers divisible by 4. it works fine. but I want output in a specific shape such that " 16 + 32 + 48 + 64 + 80 =240. The problem I am facing is that when I print "+" with the printf statement, the + signs also come after the last output such as 80 +. which is wrong. kindly guide me through it. The current output is : 16 + 32 + 48 + 64 + 80 + =240
#include <stdio.h>
#include <conio.h>
int main()
{
int first=0;
int second=0;
printf("Enter first number :");
scanf_s("%d",&first);
printf("Enter second number :");
scanf_s("%d",&second);
first++;
int sum=0;
while(first<=second)
{
if(first%4==0 && first%16==0)
{
printf("%d ",first);
printf("+ ");
sum+=first;
}
first++;
}
printf(" =%d ",sum);
}