Untitled
raw download clone
C
views 18
,
size 359 b
#include<stdio.h>
int main(){
	int i,j,k,l,n;
	printf("\nEnter the upper range : ");
	scanf("%d\n", &n);
	for(l=1;l<=n;l++){
		for(k=1;k<l;k++){
			for(j=1;j<k;j++){
				if((k+j)>l)
				break;
				for(i=1;i<j;i++){
					if((k+j+i)>l)
			    		break;
					if((i+j+k)==l)
					printf("%d+%d+%d=%d \n",i,j,k,l);
				}
			}
		}
	}
	return 0;
}
close fullscreen
Login or Register to edit or fork this paste. It's free.