Answers for "c program to print odd numbers between specified ranges recursion"

0

c program to print odd numbers between specified ranges recursion

#include <stdio.h>
int printodd(int first,int end){
    int i=first;
    if(i<=end){
        if(i%2!=0)
        printf("%d\t",i);
        i++;
        printodd(i,end);
    }
}


int main()
{
int first,last;

printf("please enter the first number in the range:");
scanf("%d",&first);
printf("please enter the last number in the range:");
scanf("%d",&last);
int odd=printodd(first,last);
printf("%d",odd);


    return 0;
}
Posted by: Guest on May-29-2021

Code answers related to "c program to print odd numbers between specified ranges recursion"

Browse Popular Code Answers by Language