Program to find the positive number

Tuesday, August 11, 2020

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

#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();

}

You Might Also Like

0 Comments

Like us on Facebook

Flickr Images

Flickr Short Films