online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
//Заполнена анкета на учеников: фамилия, место работы родителей. //Определите сколько родителей работают на заводе им. Масленникова, для //экскурсии у кого родители работают в драматическом театре, или в театре //оперы и балета, или в филармонии #include <stdio.h> #include <stdlib.h> #include <string.h> #define N 2 struct student { char surname[20]; char parents_work[25]; }; int main() { int count = 0; struct student class[N]; for (int i = 0; i < N; i++) { printf("Введите фамилию: "); fgets(class[i].surname, strlen(class[i].surname), stdin); printf("Введите место работы родителей: "); fgets(class[i].parents_work, strlen(class[i].parents_work), stdin); } for (int i = 0; i < N; i++) { if (strcmp("Завод им. Масленникова", class[i].parents_work) == 0) count++; if (strcmp("Драматический театр", class[i].parents_work) == 0) printf("%s, Драматический театр", class[i].surname); if (strcmp("Театр оперы и балета", class[i].parents_work) == 0) printf("%s, Театр оперы и балета", class[i].surname); if (strcmp("Филармония", class[i].parents_work) == 0) printf("%s, Филармония", class[i].surname); } printf("Заводчане: %d", count); return 0; }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue