fork download
  1. #include <stdio.h>
  2.  
  3. void main()
  4. {
  5. int age;
  6. printf("enter your age : ");
  7. scanf_s("%d", &age);
  8.  
  9. if (age > 18)
  10. {
  11. printf("you are elegible for voting" );
  12. }
  13.  
  14. else if (age == 18)
  15. {
  16. printf("wait for one more year" );
  17. }
  18.  
  19. else (age < 18)
  20. {
  21. printf("you are not elegible for voting" );
  22. }
  23.  
  24. }
Success #stdin #stdout 0.02s 26196KB
stdin
Standard input is empty
stdout
#include <stdio.h>

void main()
{
	int age;
	printf("enter your age : ");
	scanf_s("%d", &age);

	if (age > 18)
	{
		printf("you are elegible for voting" );
	}

	else if (age == 18)
	{
		printf("wait for one more year" );
	}

	else (age < 18)
	{
		printf("you are not elegible for voting" );
	}

}