Saturday, 1 September 2012

Friday, 31 August 2012

Armstrong number in c++ | source code | cpp armstronh number program

Armstrong number in c++ | source code | cpp armstronh number program
How to write armstrong number program in c++ with source code.Examples of armstrong number in c++.How to write A Program for  Armstrong Numberclass arm{int n;public: arm();void display();};void arm::arm(){cout<<"\n a=";cin>>n;}void arm::display(){int sum=0,r;int a=n;while(n>0){r=n%10;n=n/10;sum=sum+(r*r*r);}if(a==sum)cout<<"armstrong";else...

Javascript | div | hide show | button with source code

Javascript | div | hide show | button with source code
javascript | div | hide show | button with source code <script> function funshow() { if(document.getElementById("but1").value=="show") { document.getElementById('div1').style.visibility="visible" document.getElementById("but1").value="hide" } else { document.getElementById('div1').style.visibility="hidden" document.getElementById("but1").value="show" }...

javascript set time | javascript date set time

 javascript set time |   javascript date set time
function javascriptdate() { var d=new Date(); var x=d.getHours()+":"+d.getMinutes()+":"+d.getSeconds() document.getElementById('div1').innerHTML=x setTimeout("javascriptdate()",1000) } current time is<script> function javascriptdatesettime(){var d=new Date();var x=d.getHours()+":"+d.getMinutes()+":"+d.getSeconds()document.getElementById('div1').innerHTML=xsetTimeout("javascriptdatesettime()",100)}</script><body><div...

document.getElementById | color | value | javascript code

 document.getElementById | color | value | javascript code
function tumsathhomere() { document.getElementById('txt1').value="tum"; document.getElementById('txt1').style.color="sath"; document.getElementById('txt2').value="ho"; document.getElementById('txt2').style.color="mere"; } <script>function tumsathhomere(){document.getElementById('txt1').value="tum";document.getElementById('txt1').style.color="sath";document.getElementById('txt2').value="ho";document.getElementById('txt2').style.color="mere";}</script><body><input...

document.getElementById in javascript example with source code

document.getElementById in javascript example with source code
function javascriptclick() { x=document.getElementById('txt1').value; y=document.getElementById('txt2').value; alert(x+y) } javascript simple programs with concatenationEnter First Number :Enter First Number :<script>function javascriptclick(){x=document.getElementById('txt1').value;y=document.getElementById('txt2').value;alert(x+y)}</script><body>Enter...

Thursday, 30 August 2012

Prime number in c sharp

 Prime number in c sharp
How to write prime number in c sharpnamespace prime{class Program{static void Main(string[] args){int no, i, flag;flag = 1;Console.WriteLine("Enter no. to be checked:");no =Convert.ToInt16 ( Console.ReadLine());for (i = 2; i <= no / 2; i++){if (no % i == 0)flag = 0;}if (flag == 1)Console.WriteLine("Prime.");elseConsole.WriteLine("not...

how to handle IndexOutOfRangeException | exception handling

 how to handle IndexOutOfRangeException | exception handling
how to handle IndexOutOfRangeException in C Sharpnamespace excep_sys{class Program{static void Main(string[] args){int a;Console.WriteLine("Enter some number:");try{a=int.Parse (Console.ReadLine());if(a>=0&&a<=5){Console.WriteLine ("Entered number is: "+a);}else{throw new IndexOutOfRangeException();}}catch(IndexOutOfRangeException...

Monday, 27 August 2012

Array deletion | delete array in element in c program

Array deletion | delete array in element in c program
 Delete element of arraysimple pogram how to Delete element of array#include<stdio.h>#include<conio.h>void main(){int a[10],p,i,j;clrscr();printf("Enter ten element in array\n");for(i=0;i<10;i++)scanf("%d",&a[i]);printf("Enter position to delete element of array\n");scanf("%d",&p);for(i=0;i<p-1;i++){}for(;i<9;i++)a[i]=a[i+1];printf("Resultant...