Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  table
Language: C/C++
Code:
/******************************************************************************

                              Online C++ Compiler.
               Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.

*******************************************************************************/

#include <iostream>
#include <fstream>
#include <string>

using namespace std;

int main()
{
    int broj_redova;
    int broj_stupaca;
    
    char navodnici = 34;
    
    ofstream outfile;
    outfile.open("tablice_kod.txt", ios::out);
    
    cout << "Unesite broj redaka tablice: ";
    cin >> broj_redova;
    cout << endl << "Unesite broj stupaca tablice: ";
    cin >> broj_stupaca;
    
    outfile << "<table border=" << navodnici << "1" << navodnici << ">";
    
    for (int i = 0; i < broj_redova; i++){
        
        outfile << "<tr>";
        
        for(int j = 0; j < broj_stupaca; j++){
            
            outfile << "<td></td>";
        }
        
        
        outfile << "</tr><br>\" <<endl;
        
    }
    
    outfile << "</table>";
    
    outfile.close();

    return 0;
}
          
          
Comments: