Skip to content

This is my program using exit function when user enter Zero it will exit otherwise the square of number #390

Description

@Mallikarjun9741

#include<stdio.h>
#include<stdlib.h>
int main()
{
int n, square;
while(1) {
printf("Enter the number:");
scanf("%d" ,&n);
if (n==0)
{
printf(" your entered number is zero!.\n");

exit(0);
} else {

	square=n*n;
	printf("square of the number %d is %d\n" ,n,square);
}
}
return 0;

}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions