Skip to main content

Featured

Bulb ON/OFF Animation in html and css

<!DOCTYPE html > <html> <style>   *,   *::after,   *::before {     box-sizing: border-box;   }     body {     background: #001933;   }     .container {     width: 75px;     height: 275px;     animation: bulb-swing 3s infinite ease-in-out;     transform-origin: top center;     position: absolute;     top: 0;     left: calc(50% - (75px/2));   }     .container.paused {     animation-play-state: paused;   }     .bulb {     z-index: 10;     display: block;     width: 75px;     height: 75px;     border-radius: 50%;     position: absolute;     top: 200px;     left: calc(50% - (75px/2));   ...

Tricky pattern in c language

#include<stdio.h>
int main( ){
	int wh=5; 
	int wl=4;
	int i,j,k;
	int is=1; //inner space 
	int os =2; //outer space
	
	for(i=0; i<=wh; i++){
		for(j=1; j<=wl; j++){
			for(k=0; k<=os; k++){
				printf(" ");
			}
			printf("%d",j);
			for(k=1; k<=is; k++){
				printf(" ");
			}
			printf("%d",j);
			for(k=1; k<=os; k++){
				printf(" ");
			}
			printf(" ");
		}
		os=(i+1!=wh);
		is=(i+1!=wh)?3:5;
		printf("\n");
	}
	return 0;
}
	
	


Output:

Comments

Popular Posts