Category: C language learning

Enter 4 integers and find the maximum value recursively 0

Enter 4 integers and find the maximum value recursively

Hits: 0#include <stdio.h> int max_num(int a[],int curr,int next,int next_next) { int max; max = a[curr]>a[next]?a[curr]:a[next]; else { if(a[curr]>a[next]) else max_num(a,next,next_next,next_next+1); } } void main() { int j; int num[4]; for(j=0;j<4;j++) scanf("%d",&num[j]); printf("\n%d",max_num(num,0,1,2)); }

C language learning – C language basics 0

C language learning – C language basics

Hits: 0Table of contents One: macro definition Two: const modification means that the constant value cannot be modified again Three: function Four: character array Five: basic data types Six: system Seven: Identifier Definition Rules...