Skip to content

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

@2025CS0475

Description

@2025CS0475

#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;

}

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