Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

269
Views
Why this code is showing "error: label at end of compound statement"?

I wanted to check by placing default anywhere in the switch. It should print the default printf statement as no case label is matching & after that default case is checked in the switch. But it's showing the above error.

#include <stdio.h>

int main(void) {
    // your code goes here
    char ch='g';
    switch(ch){
        default: printf("Success!\n");
        case 'v':
        case 'h':
    }
    return 0;
}
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Try putting break; after the case statements.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!