1.

Write a C program to read the value of an integer m and display the value of n is 1 when m is larger than 0, 0 when m is 0 and -1 when m is less than 0.

Answer»

tion:#include VOID MAIN(){ INT m,N; printf("Input the value of m :"); SCANF("%d",&m); if(m!=0) if(m>0) n=1; else n=-1; else n=0; printf("The value of m = %d \n",m); printf("The value of n = %d \n",n);}



Discussion

No Comment Found