Program to enter an integer and print out its successor 1 Attachment(s) Program to enter an integer and print out its successor #include #include 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; } It then determines the successor of the integer and outputs it using the 'cout' command. Sample Input 49 Sample Output The successor of 49 is 50. |
All times are GMT +5. The time now is 01:53 PM. |
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.