Syvum Home Page

Home > Quiz Games > C++ Programming > Print Preview

C++ Programming : Program 13-A

Program to enter an integer and print out its successor


 

#include <iostream.h>
#include <conio.h>
void value(int);

void main()
{
clrscr();
int x;
cout << "Enter an integer : ";
cin>>x;
cout << "The successor of " << x << " is ";
value(x);
getch();
}
void value(int x)
{
x++;
cout << x << "." << endl;
}

This program takes in an integer x as a screen input from the user.
It then determines the successor of the integer and outputs it using the 'cout' command.

49

The successor of 49 is 50.

Index of C++ Programs
 

-
-
 
45 more pages in C++ Programming

Contact Info © 1999-2024 Syvum Technologies Inc. Privacy Policy Disclaimer and Copyright