digits of a number. To invert number look at it and write it from opposite direction or the output of code is a number obtained by writing original number from right to left. To reverse or invert large numbers use long data type or long long data type if your compiler supports it, if you still have large numbers then use strings or other data structure. C programming code #include <stdio.h> int main() { int n, reverse = 0; printf("Enter a number to reverse\n"); scanf("%d",&n); (n != 0) { reverse = reverse * 10; reverse = reverse + n%10; n = n/10; } printf("Reverse of entered number is = %d\n", reverse); return 0; } Prime number program in c: c program for prime number, this code prints prime numbers using c programming language. To check whether a number is prime or not see another code below. Prime number logic: a number is prime if it is divisible only by one and itself. Remember two is the only even and also the smallest prime number. First few prime numbers are 2, 3, 5, 7, 11, 13, 17....etc. Prime numbers have many applications in computer science and mathematics. A number greater than one can be factorized into prime numbers, For example 540 = 22*33*51 Prime number program in c language #include<stdio.h> int main() { int n, i = 3, count, c; the number of prime numbers required\n"); scanf("%d",&n); if ( n >= 1 ) { printf("First %d prime numbers are :\n",n); printf("2\n"); }
digits of a number. To invert number look at it and write it from opposite direction or the output of code is a number obtained by writing original number from right to left. To reverse or invert large numbers use long data type or long long data type if your compiler supports it, if you still have large numbers then use strings or other data structure. C programming code #include <stdio.h> int main() { int n, reverse = 0; printf("Enter a number to reverse\n"); scanf("%d",&n); (n != 0) { reverse = reverse * 10; reverse = reverse + n%10; n = n/10; } printf("Reverse of entered number is = %d\n", reverse); return 0; } Prime number program in c: c program for prime number, this code prints prime numbers using c programming language. To check whether a number is prime or not see another code below. Prime number logic: a number is prime if it is divisible only by one and itself. Remember two is the only even and also the smallest prime number. First few prime numbers are 2, 3, 5, 7, 11, 13, 17....etc. Prime numbers have many applications in computer science and mathematics. A number greater than one can be factorized into prime numbers, For example 540 = 22*33*51 Prime number program in c language #include<stdio.h> int main() { int n, i = 3, count, c; the number of prime numbers required\n"); scanf("%d",&n); if ( n >= 1 ) { printf("First %d prime numbers are :\n",n); printf("2\n"); }