fork download
  1. #include<stdio.h>
  2.  
  3.  
  4. int na1,nt1,ne1,na2,nt2,ne2,tot,op;
  5. char mat[30];
  6.  
  7. void main()
  8. {
  9. clrscr();
  10. printf("MENU DE OPCIONES");
  11. printf("\n 1. Diseño I");
  12. printf("\n 2. Planeamiento estratégico");
  13. printf("\n 3. Introducción a la Programación");
  14. printf("\n 4. DHTML");
  15. printf("\n 5. Idioma Español");
  16. printf("\n 6. Inglés I");
  17. printf("\n 7. Salir");
  18. printf("\n Elija una opcion: ");scanf("%d",&op);
  19. switch (op)
  20. {
  21. case 1:
  22. mat='diseño I';
  23. datos();
  24. break;
  25. case 2:
  26. mat="Planeamiento estratégico";
  27. datos();
  28. break;
  29. case 3:
  30. mat="Planeamiento estratégico";
  31. datos();
  32. break;
  33. case 4:
  34. mat="DHTML";
  35. datos();
  36. break;
  37. case 5:
  38. mat="Idioma Español";
  39. datos();
  40. break;
  41. case 6:
  42. mat="Inglés I";
  43. datos();
  44. break;
  45. case 7:
  46. printf("\n\n Usted ha elegido salir.");
  47. break;
  48. default:
  49. printf("\n\n Error en la opcion elegida.");
  50. getch();
  51. }
  52. }
  53.  
  54.  
  55. void datos(void)
  56. {
  57. clrscr();
  58. printf("%s",&mat);
  59. printf("\n\n Nota de gestión en aula del 1er Parcial: "); scanf("%d",&na1);
  60. printf("\n Nota de gestión por tutorías del 1er Parcial: "); scanf("%d",&nt1);
  61. printf("\n Nota del examen del 1er Parcial: "); scanf("%d",&ne1);
  62. printf("\n Nota de gestión en aula del 2do Parcial: "); scanf("%d",&na2);
  63. printf("\n Nota de gestión por tutorías del 2do Parcial: "); scanf("%d",&nt2);
  64. printf("\n Nota del examen del 2do Parcial: "); scanf("%d",&ne2);
  65.  
  66. tot=((na1+na2)/2)/4+((nt1+nt2)/2)/4+((ne1+ne2)/2)/2;
  67. if(tot>=13)
  68. {
  69. printf("\n\t Aprobado.");
  70. }
  71. else{
  72. printf("\n\t Reprobado.");
  73. }
  74. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:22:5: warning: character constant too long for its type
prog.cpp:7: error: ‘::main’ must return ‘int’
prog.cpp: In function ‘int main()’:
prog.cpp:9: error: ‘clrscr’ was not declared in this scope
prog.cpp:22: error: incompatible types in assignment of ‘int’ to ‘char [30]’
prog.cpp:23: error: ‘datos’ was not declared in this scope
prog.cpp:26: error: incompatible types in assignment of ‘const char [26]’ to ‘char [30]’
prog.cpp:30: error: incompatible types in assignment of ‘const char [26]’ to ‘char [30]’
prog.cpp:34: error: incompatible types in assignment of ‘const char [6]’ to ‘char [30]’
prog.cpp:38: error: incompatible types in assignment of ‘const char [16]’ to ‘char [30]’
prog.cpp:42: error: incompatible types in assignment of ‘const char [10]’ to ‘char [30]’
prog.cpp:50: error: ‘getch’ was not declared in this scope
prog.cpp:18: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result
prog.cpp: In function ‘void datos()’:
prog.cpp:57: error: ‘clrscr’ was not declared in this scope
prog.cpp:58: warning: format ‘%s’ expects type ‘char*’, but argument 2 has type ‘char (*)[30]’
prog.cpp:59: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result
prog.cpp:60: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result
prog.cpp:61: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result
prog.cpp:62: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result
prog.cpp:63: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result
prog.cpp:64: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result
stdout
Standard output is empty