This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- This is a solution for a question on stackoverflow --> | |
<!-- https://stackoverflow.com/questions/52892889/pause-resume-css-animations-when-switching-tabs --> | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>animation</title> | |
<style type="text/css"> | |
div#test { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
print("This is a calculator that takes a series of numbers separated by comma,") | |
print("calculates their frequency and returns the result in a sorted method.") | |
print("Press Ctrl+C to exit the calculator") | |
try: | |
while True: | |
print("\nEnter your series of numbers separated by a 'comma':") | |
numbers = input() | |
numbers = numbers.split(",") | |
result = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
print("This is a calculator that takes two numbers of same lenght as input, reverses them and returns the sum") | |
print("Press Ctrl+C to exit the calculator") | |
try: | |
while True: | |
print("Enter a number:") | |
first = input() | |
for a in first: | |
try: | |
int(a) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() { | |
int data[11] = {10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60}; | |
int entry, i, position=1; | |
printf("Here is the array:\n"); | |
for (i=0; i<11; i++){ | |
printf("%d\t", data[i]); | |
} | |
printf("\n"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() { | |
int rows, i, j, k, spaces, stars; | |
printf("Enter rows for your pyramid:\n"); | |
scanf("%d", &rows); | |
spaces = rows -1; | |
stars = 1; | |
if (rows % 2 > 0 && rows < 30){ | |
printf("Your pyramid should look like this:\n"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() { | |
int range, total_prime_in_range = 0; | |
printf("Enter your range:\n"); | |
scanf("%d", &range); | |
printf("The prime numbers in that range are:\n"); | |
for (int i=1; i<=range; i++){//loops through the input numbers | |
int not_prime = 0; | |
for (int j=2; j<i/2; j++){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() { | |
int number; | |
printf("Enter your number:\n"); | |
scanf("%d", &number); | |
if (number > 3){ // 1,2,3 are prime for sure; verification starts for bigger numbers; | |
for (int i = 2; i<number; i++){ | |
if (number % i == 0){ | |
printf("The number is not a prime number.\n"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() { | |
int mark; | |
printf("Enter your mark:\n"); | |
scanf("%d", &mark); | |
if (mark <= 100){ //dive in only if mark is less than 100. mark can be negative too | |
if (mark >= 79) { | |
printf("Your grade is A+\n"); | |
} else if (mark >= 69) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
//a program that checks if a number is positive or negative or nutral | |
int main() { | |
int number; | |
printf("Enter your number:\n"); | |
scanf("%d", &number); | |
if (number > 0) { | |
printf("The number is positive"); | |
} else if (number < 0){ | |
printf("The number is negative"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
//a program that checks if a number is Even or Odd | |
int main() { | |
int number; | |
printf("Enter your number:\n"); | |
scanf("%d", &number); | |
if (number % 2 == 0) { | |
printf("The number is Even"); | |
} else { | |
printf("The number is Odd"); |
NewerOlder