We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
  • Hackerrank Home
  • Prepare
    NEW
  • Certify
  • Compete
  • Career Fair
  • Hiring developers?
  1. Prepare
  2. C
  3. Conditionals and Loops
  4. For Loop in C
  5. Discussions

For Loop in C

Problem
Submissions
Leaderboard
Discussions
Editorial

    You are viewing a single comment's thread. Return to all comments →

  • manjukoni70
    2 months ago+ 0 comments

    this answer is right according to editorial output but getting test fai

    include

    include

    include

    include

    int main() { int a, b, i; scanf ("%d %d", &a, &b); for (i = a; i <= b; i++) { if (i==8) { printf("eight \n"); } if(i==9) { printf("nine \n"); } if (i==10) { printf("ten \n"); } if (i==11) { printf("eleven \n"); } } for (i = a; i <= b; i++) { if (i%2==0) { printf("even \n"); } else { printf("odd \n"); } } return 0; }

    -7|
    Permalink
  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy