Have a Read!

Hi Everyone.
The idea for this page is to provide new c users simple c tutorials to learn how to develop the logic and more importantly correct way to write syntax.
ENJOY !!!

Tuesday, January 25, 2011

C PROGRAM FOR CALCULATING REMAINDER

The following code will print the remainder as a result of two numbers
#include <stdio.h>
int main() {

int x,y,z;

printf("ENTER THE NUMBER TO BE DIVIDED\n");

scanf(“%d”,&x);

printf("ENTER THE DIVISOR\n");

scanf("%d",&y);

z=x%y;

printf("THE REMAINDER IS %d\n",z);

return 0;
}

No comments:

Post a Comment

Related Posts with Thumbnails