Program to find the positive number | Learn C++ (Introduction and Tutorials to C++ Programming)

C++ 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 | Learn C++ (Introduction and Tutorials to C++ Programming)
//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();
}
Program to find the positive number | Learn C++ (Introduction and Tutorials to C++ Programming) Program to find the positive number | Learn C++ (Introduction and Tutorials to C++ Programming) Reviewed by SHERE KHOJRAHA on February 13, 2019 Rating: 5

No comments:

Powered by Blogger.