fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. // CGI header
  5. printf("Content-Type: text/html\n\n");
  6.  
  7. // HTML content
  8. printf("<!DOCTYPE html>\n");
  9. printf("<html>\n");
  10. printf("<head>\n");
  11. printf("<title>My C Webpage</title>\n");
  12. printf("</head>\n");
  13. printf("<body>\n");
  14. printf("<h1>Hello from C!</h1>\n");
  15. printf("<p>This webpage is generated using a C CGI script.</p>\n");
  16. printf("</body>\n");
  17. printf("</html>\n");
  18.  
  19. return 0;
  20. }
Success #stdin #stdout 0s 5280KB
stdin
Standard input is empty
stdout
Content-Type: text/html

<!DOCTYPE html>
<html>
<head>
<title>My C Webpage</title>
</head>
<body>
<h1>Hello from C!</h1>
<p>This webpage is generated using a C CGI script.</p>
</body>
</html>