Get Update on recent Technology & Programming

Wednesday, 15 November 2017

C Program to find quotient and remainder

Posted by   on Pinterest

C Program to find quotient and remainder






#include<stdio.h>

int main(void)

{

 int x,y,quo,rem;

 printf("Enter two numbers : ");

 scanf("%d%d",&x,&y);

 if(y)  /*if y is non-zero*/

 {

  quo=x/y; 

  rem=x%y;

  printf("Quotient=%d, Remainder=%d\n",quo,rem);

 } 

 else

  printf("Divide by zero error\n");

 return 0;

}




No comments:
Write comments

Hey, we've just launched a new custom color Blogger template. You'll like it -
Join Our Newsletter