New paste Repaste Download
#include <iostream>
#include <fstream>
using namespace std;
bool tableau = false ;
bool fonction_boucle_cout() {
for ( int variable = 0;  variable <= 1000; variable++ ){
cout << "Valeurs de 1 à 1000 : " << variable << endl;
}
tableau = true ;
return tableau;
}
bool fonction_boucle_file() {
fstream my_file;
my_file.open("my_file.txt", ios::out);
if (!my_file) {
cout << "File not created!";
}
else {
cout << "File created successfully!\n";
for ( int variable = 0;  variable <= 1000; variable++ ){
my_file << "Valeur :" << variable << endl;
}
my_file.close();
}
tableau = true ;
return tableau;
}
int main() {
fonction_boucle_cout();
fonction_boucle_file();
return 0 ;
}
Filename: None. Size: 741b. View raw, , hex, or download this file.

This paste expires on 2026-09-02 04:00:59.559558+00:00. Pasted through web.