#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.
It then determines the successor of the integer and outputs it using the 'cout' command.
Tidak ada komentar:
Posting Komentar