# Author Archives

An Armstrong number, also known as narcissistic number, is a number that is equal to the sum of the...

#### Check Armstrong number or Not in R Programming Language

An Armstrong number, also known as narcissistic number, is a number that is equal to the sum of the...

year = as.integer(readline(prompt=”Enter a year: “)) if((year %% 4) == 0) { if((year %% 100) == 0) { if((year...

#### Leap year or not in R Programming Language

year = as.integer(readline(prompt=”Enter a year: “)) if((year %% 4) == 0) { if((year %% 100) == 0) { if((year...

The factorial of a number is the product of all the integers from 1 to that number. For example,...

#### Factorial of a number in R Programming Language

The factorial of a number is the product of all the integers from 1 to that number. For example,...

nterms = as.integer(readline(prompt=”How many terms? “)) # first two terms n1 = n2 = 1 count = 2 # check if the number of terms is valid if(nterms <= 0) { print(“Plese enter a positive integer”) } else { if(nterms == 1) { print(“Fibonacci sequence:”) print(n1) } else { print(“Fibonacci sequence:”) print(n1) print(n2) while(count

#### Fibonacci Sequence in R Programming Language

nterms = as.integer(readline(prompt=”How many terms? “)) # first two terms n1 = n2 = 1 count = 2 # check if the number of terms is valid if(nterms <= 0) { print(“Plese enter a positive integer”) } else { if(nterms == 1) { print(“Fibonacci sequence:”) print(n1) } else { print(“Fibonacci sequence:”) print(n1) print(n2) while(count

num = as.integer(readline(prompt = “Enter a number: “)) # use for loop to iterate 10 times for(i in 1:5)...

#### Multiplication Table in R Programming Language

num = as.integer(readline(prompt = “Enter a number: “)) # use for loop to iterate 10 times for(i in 1:5)...

Sorting of vectors can be done using the sort() function. By default, it sorts in ascending order. To sort...

#### Sort a vector in R Programming Language

Sorting of vectors can be done using the sort() function. By default, it sorts in ascending order. To sort...

Determines the location, i.e., index of the (first) minimum or maximum of a numeric vector. Usage which.min(x) which.max(x) x...

#### Find the position of minimum and maximum of value in R Programming Language

Determines the location, i.e., index of the (first) minimum or maximum of a numeric vector. Usage which.min(x) which.max(x) x...

x <- c(2 ,3 ,4 ,6,1) min(x) y <- c(78,34,5,67,41,33) max(y) Output: \$Rscript main.r 1 78

#### Find the maximum and minimum number in R Programming Language

x <- c(2 ,3 ,4 ,6,1) min(x) y <- c(78,34,5,67,41,33) max(y) Output: \$Rscript main.r 1 78

x <- c(2 ,3 ,4 ,4) y <-c(3, 4 ,5 ,6) print (x+y) print(x-y) print(x*y) print(x/y) print(x%%y) print(x^y) or...

#### Write a R Program to Two vector Variables (Addition, Subtraction, Multiplication, Division, Mod, Coefficient)

x <- c(2 ,3 ,4 ,4) y <-c(3, 4 ,5 ,6) print (x+y) print(x-y) print(x*y) print(x/y) print(x%%y) print(x^y) or...

2+3 //Add 2-3 //Sub 2*3 //Mul 2/3 //Div 2+2+3*4-4/3 // Add, Mul, Sub, Div Output: 5 -1 ...

#### R Programs to Add, Sub, Mul, and Div

2+3 //Add 2-3 //Sub 2*3 //Mul 2/3 //Div 2+2+3*4-4/3 // Add, Mul, Sub, Div Output: 5 -1 ...

First R Program: print (“Hello world!”) Output: “Hello world!” print (“Hello World!”, quote-FALSE) Output: Hello...

#### Simple way:” Hello world program in R”

First R Program: print (“Hello world!”) Output: “Hello world!” print (“Hello World!”, quote-FALSE) Output: Hello...

ASCII Value of ALL characters #include <stdio.h> int main() { int i; for(i=0;i<255;i++) { printf(“ASCII value of character %c=%d\n”,i,i);...

#### Write a C program ASCII values of all Characters

ASCII Value of ALL characters #include <stdio.h> int main() { int i; for(i=0;i<255;i++) { printf(“ASCII value of character %c=%d\n”,i,i);...

Only ASCII values #include <stdio.h> int main() { int i; char ch; for(i=0;i<256;i++) { printf(“%c”,ch); ch=ch+1; } return 0;...

#### Write a C Program to Only ASCII values

Only ASCII values #include <stdio.h> int main() { int i; char ch; for(i=0;i<256;i++) { printf(“%c”,ch); ch=ch+1; } return 0;...

#include <stdio.h> int main() { char ch; printf(“Enter the character”); scanf(“%c”,&ch); printf(“ASCII value of %c=%d”,ch,ch); return 0; } Output:...

#### Write a C Program to ASCII value of a Character:

#include <stdio.h> int main() { char ch; printf(“Enter the character”); scanf(“%c”,&ch); printf(“ASCII value of %c=%d”,ch,ch); return 0; } Output:...

#include<stdio.h> int main() { int i; for(i = 0; i < 26; i++){ printf(“%c = %d | %c =...

#### Write a C program to display All ASCII alphabets

#include<stdio.h> int main() { int i; for(i = 0; i < 26; i++){ printf(“%c = %d | %c =...

#include<stdio.h> int fibonacci_series(int); int main() { int count, c = 0, i; printf(“Enter number of terms:”); scanf(“%d”,&count); printf(“\nFibonacci series:\n”);...

#### Write a C Program to display Fibonacci series using recursion

#include<stdio.h> int fibonacci_series(int); int main() { int count, c = 0, i; printf(“Enter number of terms:”); scanf(“%d”,&count); printf(“\nFibonacci series:\n”);...

Factorial: using symbol “! ” Mathematical Ex: 5! = 120 (5*4*3*2*1=120)) Program: #include<stdio.h> int main() { int i,fact,number; printf(“Enter...

#### Write a C Program to find factorial of number

Factorial: using symbol “! ” Mathematical Ex: 5! = 120 (5*4*3*2*1=120)) Program: #include<stdio.h> int main() { int i,fact,number; printf(“Enter...

Examples of Armstrong Numbers: 0, 1, 2, 3, 153, 370, 407 etc. Program: #include<stdio.h> int main(){ int num,a,p,total=0; printf(“Enter...

#### Write a C program given number Armstrong number or not (only three digits)

Examples of Armstrong Numbers: 0, 1, 2, 3, 153, 370, 407 etc. Program: #include<stdio.h> int main(){ int num,a,p,total=0; printf(“Enter...