I need to make a program that stops when the user press ctrl+Z..
if the user doesn't press ctrl+Z, it won't stop the loop prompting
"Enter a Number : ".. but when the user press ctrl+Z, then it will display
"The sum of all the inputed numbers is : "..

Here's my code :

Code:
#include <stdio.h>
#include <conio.h>
#include <iostream.h>

int main(void) {
     clrscr();
     
   do {
   for ( int i = 0; ; i++ ) {
    int num[i]. sol[i];
   }
   cout<<"Enter a Number : ";
   cin >> num[i];
   sol[i] += num[i];
   if ( cin.eof() ) {
    cout<<"The Sum is : " << sol[i];
   } while ( !cin.eof() );
   getch();

}
but it wont work.. D: