Tags » Iteration

Gall's Law

“A complex system that works is invariably found to have evolved from a simple system that worked. A complex system designed from scratch never works and cannot be patched up to make it work. 13 more words

Software

Factorial

#include<stdio.h>
void main(){
	int num,i,fact=1;
	printf("Enter any number:\n");
	scanf("%d",&num);
	for(i=num;i>1;i--){
		fact=fact*i;
	}
	printf("The factorial is %d\n",fact);
}
C

Prime Number

#include<stdio.h>
#include<math.h>
void main(){
	int num,limit,i,flag=1;
	printf("Enter any number:\n");
	scanf("%d",&num);
	if(num<2){
		flag=0;
	}else if(num==2){
		flag=1;
	}else if(num%2==0){
		flag=0;
	}else{
		limit=sqrt(num);
		for(i=3;i<=limit;i+=2){
			if(num%i==0){
				flag=0;
				break;
			}
		}
	}
	if(flag){
		printf("The number is Prime.\n");
	}else{
		printf("The number is not Prime.\n");
	}
}
C

Armstrong Number

#include<stdio.h>
#include<math.h>
void main(){
	int num,temp,sum=0;
	printf("Enter any number:\n");
	scanf("%d",&num);
	for(temp=num;temp>0;temp/=10){
		sum+=pow(temp%10,3);
	}
	if(num==sum){
		printf("The number is Armstrong.\n");
	}else{
		printf("The number is not Armstrong.\n");
	}
}
C

Palindrome Number

#include<stdio.h>
void main(){
	int num,temp,rev=0;
	printf("Enter any number:\n");
	scanf("%d",&num);
	for(temp=num;temp>0;temp/=10){
		rev=(rev*10)+(temp%10);
	}
	if(rev==num){
		printf("The number is Palindrome.\n");
	}else{
		printf("The number is not Palindrome.\n");
	}
}
C

Official App Icon

We’re excited to share with you our variations iterations for the official app icon for Kanji Samurai! The upper row Kanji reads “samurai” and the bottom Kanji reads “katana”. 128 more words

Kanji

Square root without the √ key

L1 A:X=1
L2 Lbl 0:Y=(X+A/X)/2
L3 X≠Y⇒X=Y:Goto 0:≠⇒YΔ

The above is close to the shortest possible computer program that performs a useful numerical iteration. It prompts the user for a number A and computes its square root, correct to ten significant figures. 633 more words

Casio