C Program to round off an integer i to the next largest multiple of another integer j

Posted: January 19, 2012 in Lab 2
#include<stdio.h>
void week(int * ,int*);
void week(int *a,int *c)
{
int b;
b=*a%*c;
if(b==0)
printf("%d",*a);
else
printf("%d",*a+*c-b);
}
void main()
{
int i,j;
printf("Enter the value of i and j");
scanf("%d%d",&i,&j);
week(&i,&j);
}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s