This program takes an input from the user in the console window and checks if the entered number is an armstrong number. A number is said to be an Armstrong number if and only if the sum of the cubes of each individual digit in that number equals to that number.This program is done in python. def arm(x): m=x; s=0; while (m>0): r=m%10; s=s+r*r*r; m=m/10; if(s==x): print x print ” Is An Armstrong Number”; else: print x print ” Is Not An Armstrong Number”;x=input();arm(x); Description: The arm(x) performs operations on…

Read More# Month: May 2015

## Dynamic Calculator With natural Input

This program takes input as an expression which contains two operands as for now, the program then finds the operator and displays which operation is done on that operation along with the result. This program is desigened in C language. #include<stdio.h>// Function add for addition of values passed by calcint add(int f, int g){ int res=0; res = f+g; return res; // Returns an int value for printing in calc}// Function sub for Subtraction of values passed by calcint sub(int f, int g){ int res=0; res = f-g; return res;…

Read More## Custom Character Generator for 16×2 LCD

This is custom character generator developed using JAVA which can come handy while working with 16×2 LCD. The EditText box shows the array with dataof 8 rows in decimal. Below i have attached the source code of it. Source Code: import java.awt.Color;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import java.awt.event.KeyEvent;import java.awt.event.MouseAdapter;import java.awt.event.MouseEvent;import javax.swing.ImageIcon;import javax.swing.JButton;import javax.swing.JEditorPane;import javax.swing.JFrame;import javax.swing.JMenu;import javax.swing.JMenuBar;import javax.swing.JMenuItem;import javax.swing.JTextField;public class gui { JFrame frame= new JFrame(); JButton[] b= new JButton[40]; int looper=0; JTextField result; String arrayVal=”{11,21,32,41,52,62,72,82}”; StringBuilder tempString = new StringBuilder(“00011111”); StringBuilder tempString2 = new StringBuilder(arrayVal); int[] individulaBit=new int[40]; int no=0; public static…

Read More## Number of squares present between two numbers

The following program prints the number of squares present between two numbers.The program is implemented using C++ language.Ex:Let the two numbers be 3 and 9.There are two squares between them i.e. 4 and 9.So the output will be 2. #include<iostream>#include<math.h>using namespace std;int main(){ int x,y; cout<<“Enter two elements : “<<endl; cin>>x>>y; x=sqrt(x-1); y=sqrt(y); cout<<“nThe number of squares present : “<<(y-x); return 0;} Description : In the above program let the two elements be A and B. x is the square root of A and y is the square root of…

Read More## Fibonacci Series using the recursive method

The following program prints the Fibonacci series.This program is implemented using recursive method. The Fibonacci series is a series of numbers in which the current number is the sum of two previous Fibonacci numbers. This program is coded using the C language.Ex: 0,1,1,2,3,5,8,13…. #include<stdio.h>int main(){ int n,i; printf(“Enter the number of terms : “); scanf(“%d”,&n); printf(“nThe Fibonacci series is :n”); for (i=0;i<=n;i++) printf(“%d “, Fibonacci(i)); return 0;}int Fibonacci(int n){ if(n==0) return 0; else if(n==1) return 1; else return(Fibonacci(n-1)+Fibonacci(n-2));} Description: The above program prints the number of terms in Fibonacci Series.…

Read More## sPad, VI like sample text editor v1.0

sPad is a Btech mini project. In this program you have the access to create view and save files. This is completely based on Command Line Interface. The zip contains a folder sPad and a powerpoint pptx file which will explain all its mechanish. Inside the sPad folder there are 5 header files init,open, pre,save and start apart form these there is a .cpp file which is the Driver program. you need to compile that file which will genenrate a executable file. Understanding pre.h…This file includes the basic header files namely…

Read More## Find the repetition of a number in an interger array

This program can be used to find the number of times a number repeats in a given array of the integers. In this program the size of the array is 10, you can change it to your requirements. This program is designed using the java language, using array of integers. import java.util.Scanner;class counter{ int a[]=new int[10],b[]=new int[10]; void getit() { Scanner s= new Scanner(System.in); System.out.println(“Enter The Array Elements:”); for (int i=0;i<10;i++) { a[i]=s.nextInt(); b[i]=0; } } void occu(int x) { int c=0; for(int i=0;i<10;i++) { if(a[i]==x) { c=c+1; b[i]=1; }…

Read More## Fibonacci Series using the iterative method

The following program prints the Fibonacci series.The first program is implemented using iterative method. The Fibonacci series is a series of numbers in which the current number is the sum of two previous numbers. This program is coded using the C language. Ex: 0,1,1,2,3,5,8,13…. #include<stdio.h>int main(){ int n,a=0,b=1,c,i; printf(“Enter the number of terms : “); scanf(“%d”,&n); printf(“nThe Fibonacci series is :n”); if(n==0) return 0; else if(n==1) printf(“%d”,a); else { printf(“%d %d “,a,b); for (i=2;i<n;i++) { c=a+b; a=b; b=c; printf(“%d “,c); } } return 0;} Description:The above program prints the number…

Read More## Maximum and Minimum of two numbers using simple algebra

This program finds the bigger and the smaller between two numbers. In this program no comparission operator is used. neither any switch case or if else statement. Math.h library is included because it contains the abs() and sqrt() which are used in the computation of the max and min. #include<stdio.h>#include<math.h>int main(){ int a,b,max,min; printf(“Enter The value of A: “); scanf(“%d”,&a); printf(“Enter The value of B: “); scanf(“%d”,&b); max=abs((sqrt((a*a+b*b)-(2*a*b))+(a+b))/2); min=abs((sqrt((a*a+b*b)-(2*a*b))-(a+b))/2); printf(“The Max is: %d, and the Min is: %d”,max,min); return 0;} Description:This program finds the maximum and minimum values by computing…

Read More## Factorial of any number (0-9999999999)

This is a simple program which is used to calculate the factorial of any number. It accepts a single digit number and even a 10 digit number to calculate the factorial ! This program is designed using python programming language. def fact(x): f=1; for i in range (1,x+1): f=f*i; print “factorial is: ” print f;x=input();fact(x); Description:The Function fact(x) takes a number a and performs calculation on that number.

Read More