## What is a Scripting Language?

A scripting language is a programming language that is interpreted. It is translated into machine code when the code is run, rather than beforehand. Scripting languages are often used for short scripts over…

Example: Check Prime and Armstrong #include <math.h> #include <stdio.h> int checkPrimeNumber(int n); int checkArmstrongNumber(int n); int main() { int n, flag; printf(“Enter a positive integer: “); scanf(“%d”, &n); // check prime number flag…

## Reverse a sentence using recursion

#include <stdio.h> void reverseSentence(); int main() { printf(“Enter a sentence: “); reverseSentence(); return 0; } void reverseSentence() { char c; scanf(“%c”, &c); if (c != ‘\n’) { reverseSentence(); printf(“%c”, c); } } Output…

## Program to convert binary to decimal

#include <math.h> #include <stdio.h> int convert(long long n); int main() { long long n; printf(“Enter a binary number: “); scanf(“%lld”, &n); printf(“%lld in binary = %d in decimal”, n, convert(n)); return 0; }…

## GCD of Two Numbers using Recursion

#include <stdio.h> int hcf(int n1, int n2); int main() { int n1, n2; printf(“Enter two positive integers: “); scanf(“%d %d”, &n1, &n2); printf(“G.C.D of %d and %d is %d.”, n1, n2, hcf(n1, n2));…

## Program to calculate power using recursion

#include <stdio.h> int power(int n1, int n2); int main() { int base, a, result; printf(“Enter base number: “); scanf(“%d”, &base); printf(“Enter power number(positive integer): “); scanf(“%d”, &a); result = power(base, a); printf(“%d^%d =…

## Power of a Number Using the while Loop

The program below takes two integers from the user (a base number and an exponent) and calculates the power. For example: In the case of 23 2 is the base number 3 is…

## Power of a Number Using the while Loop

#include <stdio.h> int main() { int base, exp; long double result = 1.0; printf(“Enter a base number: “); scanf(“%d”, &base); printf(“Enter an exponent: “); scanf(“%d”, &exp); while (exp != 0) { result *=…