Suspect code indent for conditional statements

153 Views Asked by At

currently I am working on C project and i faced the following error -

  • 8-print_base16.c:11: WARNING: suspect code indent for conditional statements (8, 15)

related with Betty coding style.

This issue based on the following code snippet:

#include <stdio.h>
/**
 * main - function or entry point
 * Return: Always 0 (success)
 **/
int main(void)
{
        char digit;

        for (digit = 0; digit <= 9; digit++)
        {
               putchar(digit + '0');
        }

        for (digit = 'a'; digit <= 'f'; digit++)
        {
                putchar(digit);
        }

        putchar('\n');
        return (0);
}

Can you help to resolve this problem please?

I have tried to write conditions so many times, but its again give the same result

1

There are 1 best solutions below

0
Shukufa Bayramzada On

I have solved it, the problem is that i have some accidental space before putchar function on the first loop. Thanks who tried to to help.