Python Program to Print all Prime Numbers in an Interval # Python program to display all the prime numbers within an interval # change the values of lower and upper for a different result lower = 800 upper = 1000 # uncomment the following lines to take input from the user #lower = int(input("Enter lower range: ")) #upper = int(input("Enter upper range: ")) print("Prime numbers between",lower,"and",upper,"are:") for num in range(lower,upper + 1): # prime numbers are greater than 1 if num > 1: for i in range(2,num): if (num % i) == 0: break else: print(num) output: Prime numbers between 800 and 1000 are: 809 811 821 823 827 829 839 853 857 859 863 877 881 883 887 907 ...
Invoke function without main in C Language. #include<stdio.h> #include<conio.h> #define FIRST 0 #define SECOND 1 #define THIRD 2 //Variables int a,b,c,ch; float d; //Function Prototype void Read(); void Operation(); void Display(); #pragma startup Read 0 //First_Priority #pragma startup Operation 1 //Second_Priority #pragma exit Display //Third_Priority void main() { printf(" Enter to main() "); getch(); printf(" Exit From main() "); getch(); } void Read() { clrscr(); printf(" Enter the value of a : "); scanf("%d",&a); printf(" Enter the value of b : "); scanf("%d",&b); } void Operation() { printf(" ArithMetic Operations "); printf("--------------------- "); printf("1 -> Addition "); printf("2 -> Subtraction "); printf("3 -> Multiplication "); printf("--...
The JavaScript language Here we learn JavaScript, starting from scratch and go on to advanced concepts like OOP. We concentrate on the language itself here, with the minimum of environment-specific notes
Comments
Post a Comment