Skip to main content
  • Facebook
  • Google
  • Dribble
  • Linkedin
  • Pinterest
  • RSS Feeds
Home

Techie Tet

  • Home
September 1
  • Posted By: pradeeshtet
  • Comments: 0

program to find whether the number is armstrong or not

simple java program to display armstrong number. What is armstrong number - In armstrong number sum of cubes of its digits is equal to the number itself.
Example 1: 153 - 1^3+5^ 3+ 3^ 3 =1+125+27= 153, therefore 153 is armstrong number.
Example 2: 125 - 1^ 3+2^ 3+5^ 3= 1+8+125=134, therefore 125 is not an armstrong number.

The code check  the number given by user is amrstrong number or not .

 

  • Read more about program to find whether the number is armstrong or not
  • pradeeshtet's blog
  • Comments
September 1
  • Posted By: pradeeshtet
  • Comments: 0

Program to reverse digits in a number

Simple java program to reverse the digits in a number. Logic for reversing the number, sum of digits and armstrong number are similar, even in c sharp, php, c++, c.  To reverse, digits are manipulated from last position. Solution and explanation, for the program is below.

 

class RevNumber
{
public static void main(String args[])
{
int s=0,x,n=425;
while(n > 0)
{
x=n%10;
s=s*10+x;
n=n/10;
}
System.out.println(“ The Reversed number is :”+ s);
}
}

 

  • Read more about Program to reverse digits in a number
  • pradeeshtet's blog
  • Comments
August 30
  • Posted By: pradeeshtet
  • Comments: 0

fetch data from database using php/mysqli select query

fetch data from mysql table and print using php. Here data are displayed in tabular format (multiple column), but it can be changed to noraml display.  Let us see, how mysql select query retrieve and print data via php.

Very simple php code. Change the DB name and password. Connection details can also be made in different php.

<?php

$DBServer = 'localhost'; // e.g 'localhost' or '192.168.1.100'
$DBUser   = 'root';
$DBPass   = '';
$DBName   = '';

$mysqli = new mysqli($DBServer, $DBUser, $DBPass, $DBName);

  • Read more about fetch data from database using php/mysqli select query
  • pradeeshtet's blog
  • Comments
August 30
  • Posted By: pradeeshtet
  • Comments: 0

Connect database using php/mysqli

1st php mysql application using database connection. Let us see how to connect mysql database using php5.This topic covers creating a database in mysql, code or program to establish connection, print the message.
Mysqli is a relation database driver used as an interface between mysql and php .
mysqli is a replacement for the mysql fuctions, with object oriented and procedural version. If you are beginner proceed with mysqli.

  • Read more about Connect database using php/mysqli
  • pradeeshtet's blog
  • Comments
August 29
  • Posted By: pradeeshtet
  • Comments: 0

Program to find number of each vowel in a string.

Program to find number of each vowel in a string. i.e number of a, e, i, o, u separately in a string using switch case. Couting each or particular word in a string. Asked in interviews, mostly in technical round, to test programming skills. Programming languages like java, php, c++,c, c sharp.

 

  • Read more about Program to find number of each vowel in a string.
  • pradeeshtet's blog
  • Comments
August 29
  • Posted By: pradeeshtet
  • Comments: 0

Program to find total no of vowels in a string

Simple java program to find total number of vowels in a particular string. This type of question are asked in interviews, mainly in technical round, to test the programming skills. This program also helps to find the consonants.

  • Read more about Program to find total no of vowels in a string
  • pradeeshtet's blog
  • Comments
August 29
  • Posted By: pradeeshtet
  • Comments: 0

Program to Find how many 5,2 and 1 rupee

Let us see a simple program to find, how many 5rupees, 2rupees and 1rupee are there in Rs.53. Number of 5,2,1 rupees note or coins in rs.53.

Array “rup” will be holding 5,2,1. If you want to find only number of 5 and 2 rupees then remove 1.  You also add a number to that array. Change accordingly.

  • Read more about Program to Find how many 5,2 and 1 rupee
  • pradeeshtet's blog
  • Comments
August 29
  • Posted By: pradeeshtet
  • Comments: 0

Sum of numbers in array php

In php it is easy to sum the elements or values in an array by using a built in function array_sum(). Go here to know more about array_sum().

 

< ?php
$valuesAr=array(2,4,5);
echo array_sum($valuesAr);
? > 

Output displayed by this program:

11

 

Check how sum of numbers in array in java is done

  • Read more about Sum of numbers in array php
  • pradeeshtet's blog
  • Comments
August 29
  • Posted By: pradeeshtet
  • Comments: 0

Sum of elements of array program

simple java program to sum all the numbers in an integer array. Build-in function to sum a values in array is used in java8. array_sum in php.

class Sumarray{
    public static void main(String args[])  {
int[] a={8,5,6,2,4};
int sum=0;
for(int i=0;i<  a.length;i++)
{
sum +=a[i];
}
System.out.println(“Sum of array”+sum);
}}

 

output:
Sum of array 25

  • Read more about Sum of elements of array program
  • pradeeshtet's blog
  • Comments
August 26
  • Posted By: pradeeshtet
  • Comments: 0

Reverse the elements in array

Simple java program to reverse content in array. Logic is easy, it can also be used in other programming languages such as c# sharp, php... Here the index is reversed so the elements in the array are reversed.

class Reversearray{
    public static void main(String args[])  {
  int[]  oldarray={4,5,6};
  int[] resultarray=new int[3];
int m=0;
int len=oldarray.length;
for(int i=len-1;i>=0;i--)
{
resultarray[m]=oldarray[i];
m++;
}
for(int i=0;i<  oldarray.length;i++)
{
System.out.println(resultarray[i]);
}
}
}

 

output:

  • Read more about Reverse the elements in array
  • pradeeshtet's blog
  • Comments

Pages

  • « first
  • ‹ previous
  • 1
  • 2
  • 3
  • 4
  • next ›
  • last »

Recent posts

  • Engineering college performance based on Pass percentage Tamilnadu
  • Anna University CGPA calculator
  • TamilNadu 12th public exam Result 2015- TN 12th Results
  • Insertion sort algorithm simple explanation with example
  • program to sort the string in alphabetical order in java
More

User login

  • Request new password

Like us

Related post

Check Your College Rank Here

--------------------------------------------

Aptitude test

--------------------------------------------

GPA and CGPA calculator

--------------------------------------------

Prepare for interview, take a mock test here

Popular content

Today's:

  • TamilNadu 12th public exam Result 2015- TN 12th Results

All time:

  • fetch data from database using php/mysqli select query
  • GPA calculator Anna University
  • Anna University CGPA calculator
  • program to sort the string in alphabetical order in java

Last viewed:

  • TamilNadu 12th public exam Result 2015- TN 12th Results
  • GPA calculator Anna University

Some of Our Featured Projects

  • View Image

    BlackBerry Website Project

    Web
  • View Image

    Vestibulum ante ipsum primis

    Illustration
  • View Image

    Nulla mollis fermentum nunc

    Illustration
  • View Image

    Cras vel orci sapien

    Illustration / Web
  • View Image

    Curabitur nisl libero

    Illustration / Web
  • View Image

    BlackBerry Website Project

    Web
  • View Image

    Vestibulum ante ipsum primis

    Illustration
  • View Image

    Nulla mollis fermentum nunc

    Illustration
View full portofolio
↑
Powered by Techie Tet .