Check Divisible Numbers in given Range coderinme

Check Divisible Numbers in given Range coderinme

Check Divisible Numbers in given Range coderinme
C program that read integers start, end and number in the main program. It passes these 3 integers to a function subprogram that uses for loop to find those integers between start and end that are divisible by number. If it finds the number it prints them in the function only. Here the function is not returning anything. Divisible means giving a reminder of 0.

#include<stdio.h>
void f(int a, int b, int c)
{
int i;
printf("\n");
for( i = a ; i <= b ; i++ )
{
if( i % c == 0 )
{
printf("%d,",i);
}
}
}
int main()
{
int start,end,number;
printf("\nPlease Enter the start Number: ");
scanf("%d",&start);
printf("Please Enter the end Number: ");
scanf("%d",&end);
printf("Enter the number: ");
scanf("%d",&number);
f(start,end,number);
printf(" are the numbers between %d and %d which is divisible by %d",start,end,number);
getch();
return 0;
}

For more programs in C, visit our C Coder Archives

Check Divisible Numbers in given Range coderinme

All rights reserved. No part of this Post may be copied, distributed, or transmitted in any form or by any means, without the prior written permission of the website admin, except in the case of brief quotations embodied in critical reviews and certain other noncommercial uses permitted by copyright law. For permission requests, write to the owner, addressed “Attention: Permissions Coordinator,” to the admin @coderinme

Leave a reply:

Your email address will not be published.