Program to find the positive number
Tuesday, August 11, 2020C++ is one of the most popular programming languages. It is based on C but is an object-oriented programming language. It is widely used in graphics libraries, games, network devices, etc.
//Program to find the positive number
#include<iostream.h>
#include<conio.h>
void main()
{clrscr();
int num,i,sum;
cout<<"\n enter the positive number:";
cin>> num;
i=1;
sum=0;
start:
sum=sum+i;
i++;
if(i<=num)
goto start;
cout<<sum;
getch();
}
0 Comments