Showing posts with label programming. Show all posts
Showing posts with label programming. Show all posts

Sunday, January 18, 2015

Show Content Dynamically Using Javascript


Hi friends, today i will tell you how to show content dynamically using Javascript.

Here i am creating a drop down that contains 3 options when user click on any option than corresponding content will display to you.

Code :

<!DOCTYPE html>
<html>
<head>
<title>
Drop Down With Javascript
</title>
<style>
h1
{
display:none;
}
</style>
<script>
function liveShow()
{
var value=document.getElementById('city').value;
if(value=="Chennai")
{
document.getElementById("chennai").style.display="block";
document.getElementById("bangalore").style.display="none";
document.getElementById("delhi").style.display="none";
}

Sunday, January 11, 2015

C Program That Count Odd Number In Fibonacci Series

Hello friends today i am sharing a simple program that will count odd numbers with in Fibonacci series.But before that you have know about fibonacci series,so let me explain.

What is Fibonacci Series ?
       The Fibonacci series is a set of numbers that starts with a one or a zero, followed by a one, and proceeds based on the rule that each number (called a Fibonacci number) is equal to the sum of the preceding two numbers.
In mathematical terms,the sequence F(n) of Fibonacci number is defined by following recurrence relation.
F(n)=F(n-1) + F(n-2) 
with 
F(1)=1 ,F(2)=1
Or 
F(0)=0,F(1)=1

For example:-

1,1,2,3,5,8,13,21,34,........
or
0,1,1,2,3,5,8,13,21,34,.........


                         So if you enter 8, then till 8 we have 4 odd numbers(1,1,3,5).Similarly if you enter 34,then till 34 we have 6 odd numbers(1,1,3,5,13,21). 


Now try to understand this code,I am sure you can easily understand this code..:) :)


Code :-


#include<stdio.h>

#include<conio.h>

int main(){

int num,a=0,b=1,c,count=1;

printf("\n\n\n\n WAP to count odd numbers in fibonacci series");

printf("\n Enter the number:");

scanf("%d",&num);

while(1)

{

c=a+b;

Thursday, August 09, 2012

Turbo C Compiler

Friends i know that you are aware of  Turbo C Compiler because for writing C/C++ Programs we mostly use this Compiler but we don't  have basic knowledge about it.Today after read this article you get all the information about your Turbo C Compiler.

http://www.learning-tutorials.blogspot.com

Saturday, July 28, 2012

How To Read Complicated Declarations In C Language

Friends as you all know that  some declarative statements are very easy but declarative statements that contains pointer and functions are little bit complicated. Today i will tell you some steps to read  such complicated statements,after read these steps you can easily understand all the complicated statements.Its my promise:):):)


So concentrate here and try to understand all the steps.


http://www.learning-tutorials.blogspot.com


Thursday, July 26, 2012

Some Important Concepts Of C/C++ Language

Hello friends today i am telling you some important points related to C /C++ Language.These points really help you,when you do programming.I am fully sure after read this article you will get some extra knowledge about C/C++ Language,so don't waste your time and read the following points.


http://www.learning-tutorials.blogspot.com


Sunday, June 24, 2012

C Programming Tutorials Based On String And DataStructure



Hello friends,today i'm sharing some C program's that are based on string and datastructure,in all these programs i have used functions and pointers.
                   I tried to make the program's easiear for all of you,because i know that typical code can't be handeled easily.Time is very precious for us so we try to learn easy thing first:):):)



                           If You want to get these program's then please Click Here






When you click the above link then you get a zip file,this zip file contain all the  programming codes and one MS Word file in which you get a C problems.






                        Thanks Friends..........





Sunday, June 03, 2012

C Program That Convert Number To Words

Hello friends today i'm sharing a program i.e very interesting,its code is little bit big but you can easily understand it.In This program you can enter any number(maximum 4 digit) after that this program convert that number to words.

   for example:-"1234" is equivalent to "one thousand two hundred thirty four "


#include<stdio.h>
#include<conio.h>
#include<string.h>
int main()
{
 char num[100],s[100];
 int len,rem,n,j;
 clrscr();
 printf("\n Enter any number(maximam 4 digit):");
 gets(num);
 len=strlen(num);
 n=atoi(num);
 while(n!=0)
 {
     j=n;
   while(j!=0)
   {
    rem=j%10;
    j=j/10;
   }
   if(len!=2)
   {
   switch(rem)
   {
    case 1:
     printf(" one ");
     break;

    case 2:
     printf(" two ");
     break;


    case 3:
     printf(" three ");
     break;


    case 4:
     printf(" four ");
     break;

    case 5:
     printf(" five ");
     break;


    case 6:
     printf(" six ");
     break;


    case 7:
     printf(" seven ");
     break;


    case 8:
     printf(" eight ");
     break;

    case 9:
     printf(" nine ");
     break;

    case 10:
     printf(" ten ");
   }
       }
 if(len==4)
  printf(" thousand ");
 else if(len==3)
  printf(" hundred ");
 else if(len==2)
 {
  if(n==11)
  {
   printf("eleven");
   break;
  }
  else if(n==12)
  {
   printf("twelve");
   break;
  }
  else if(n==13)
  {
   printf("thirteen");
   break;
  }
  else if(n==14)
  {
   printf("fourteen");
   break;
  }
  else if(n==15)
  {
   printf("fifteen");
   break;
  }
  else if(n==16)
  {
   printf("sixteen");
   break;
  }
  else if(n==17)
  {
   printf("seventeen");
   break;
  }
  else if(n==18)
  {
   printf("eighteen");
   break;
  }
  else if(n==19)
  {
   printf("ninteen");
   break;
  }
  else if(n>=20&&n<30)
   printf(" twenty ");
  else if(n>=30&&n<40)
   printf(" thirty ");
  else if(n>=40&&n<50)
   printf(" fourty ");
  else if(n>=50&&n<60)
   printf(" fifty ");
  else if(n>=60&&n<70)
   printf(" sixty ");
  else if(n>=70&&n<80)
   printf(" seventy ");
  else if(n>=80&&n<90)
   printf(" eighty ");
  else if(n>=90&&n<100)
   printf(" ninty ");
 }
 if(len==4)
  n=n-(rem*1000);
 else if(len==3)
  n=n-(rem*100);
 else if(len==2)
  n=n-(rem*10);
 else if(len==1)
  n=n-rem;

 itoa(n,s,10);
 len=strlen(s);
 n=atoi(s);
}
 getch();
 return(0);
}



       Thanks Friends......

Friday, May 25, 2012

C Program That Convert any Binary Number To Hexadecimal Number




Hello friends,today i'm sharing a program that convert any binary number to hexadecimal number,i  try to make this code very easy to all of you,i hope you can easily understand it.If you feel any difficulty than share with me.




#include<stdio.h>
#include<conio.h>
#include<math.h>
#include<ctype.h>
void main()
{
int number,sum=0,rem,x,n,arr[100],i,j,t;
clrscr();
printf("\n\n\n Enter any binary number:");
scanf("%d",&n);
number=n;
x=0;
while(number!=0)
{
rem=number%10;
sum=sum+(rem*pow(2,x));
x++;
number=number/10;
}
i=0;
while(sum!=0)
{
t=sum%16;
if(t>=0&&t<=9)
arr[i]=t;
else if(t==10)
arr[i]='A';
else if(t==11)
arr[i]='B';
else if(t==12)
arr[i]='C';
else if(t==13)
arr[i]='D';
else if(t==14)
arr[i]='E';
else if(t==15)
arr[i]='F';
i++;
sum=sum/16;
}
printf("\n\n\n hexadecimal number of binary number %d is:",n);
for(j=i-1;j>=0;j--)
{
if(isalpha(arr[j]))
printf("%c ",arr[j]);
else
printf("%d ",arr[j]);
}
getch();
}









Thanks Friends.......

C Program That Convert Any Binary Number To Octal Number


Hello friends how are you?enjoying your life or not?today i'm sharing an interesting program with all of you,coding is very simple and you can easily understand it.If you think that this code is little bit long than share another code with me.




#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
int number,sum=0,rem,x,n,arr[100],i,j;
clrscr();
printf("\n\n\n Enter any binary number:");
scanf("%d",&n);
number=n;
x=0;
while(number!=0)
{
rem=number%10;
sum=sum+(rem*pow(2,x));
x++;
number=number/10;
}
i=0;
while(sum!=0)
{
arr[i]=sum%8;
i++;
sum=sum/8;
}
printf("\n\n\n Octal number of binary number %d is:",n);
for(j=i-1;j>=0;j--)
printf(" %d",arr[j]);
getch();
}









Thanks Friends>>>>>>

C Program That Convert The Binary Number To Decimal Number




Hello guys,today i'm sharing a program that convert any binary number to decimal number.Just go through this code and try to understand it,i'm sure that you will not face any problem while reading it.




#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
int number,sum=0,rem,x,n;
clrscr();
printf("\n\n\n Enter any binary number:");
scanf("%d",&n);
number=n;
x=0;
while(number!=0)
{
rem=number%10;
sum=sum+(rem*pow(2,x));
x++;
number=number/10;
}
printf("\n\n\ndecimal number of binary num %d is %d",n,sum);
getch();
}






********Thanks Friends********

What Is Back-end?





Hello friends,A task or operation being performed in the background without the user being aware of it is sometimes referred to as a back-end task.





      Thanks Friends....

Wednesday, May 23, 2012

What Is Argument?




Hello friends in programming or the command line an argument is a value that is passed into a command, function, or routine. In the below example, "myfile.txt" is the argument for the edit command.


edit myfile.txt


Thanks Friends.......

What Is ASCII?

Hello friends,ASCII(American Standard Code for Information Interexchange) is an industry standard, which assigns letters, numbers, and other characters within the 256 slots available in the 8-bit code.


The ASCII table is divided in 3 sections:

  • Non printable: This table contain  system codes between 0 and 31.

  • Lower ASCII: This table is generated from older American Standard with work on 7 bit code and contain characters between 32 and 127..

  • Higher ASCII: This portion is programmable, Foreign letters are also placed in this section.This table contain characters between 128 and 255.


******Thanks friends******

What Is Associative Operation?



Hello friends,in programming, an associative operation occurs when no grouping is present, where operators that have the same precedence (addition and subtraction) will be evaluated either from left to right (left-associative) or from right to left (right-associative).


For example:If no grouping(parentheses) is present than
4-3+1 give the result 2 because here we start calculation from left but if grouping is present ie 4-(3+1) then result is 0 because we first calculate (3+1).


In most programming languages, the addition, subtraction, multiplication, and division operators are left-associative, while the assignment, conditional, and exponentiation operators are right associative.




Thanks Friends........

What Is Applet?





Friends,  Applet is a small program that does a job a larger program is incapable of doing. For  instance,a Sun Java applet is a file on an Internet web page that provides additional functionality not supported by HTML.


Thanks Friends.......

What is API?



Hello friends how are you ?I know that you all are pretty well.Today i am sharing some important details about API,i hope you really enjoying it.

API(Application Program Interface) is a set of routines, protocols, and tools for building software applications. APIs allow programmers easier entry into another companies program or service. For example, large companies and communities such as Facebook and Twitter have APIs that allow programmers or website developers easier access to their services and members.



Thanks Friends.......

Sunday, May 20, 2012

C Program That Print An Amazing Pattern Using Binary Numbers


Hello friends,how are you????Enjoying my blogs or not??Today i'm sharing an interesting program i know you will take enjoy when read this code,i try to make this code very easy specialy for all of you.....



 1                       1
 1 0                   1 0
 1 0 1               1 0 1
 1 0 1 0           1 0 1 0
 1 0 1 0 1       1 0 1 0 1
 1 0 1 0 1 0   1 0 1 0 1 0
 1 0 1 0 1 0 1 0 1 0 1 0 1
 1 0 1 0 1 0   1 0 1 0 1 0
 1 0 1 0 1       1 0 1 0 1
 1 0 1 0           1 0 1 0
 1 0 1               1 0 1
 1 0                   1 0
 1                       1




#include<stdio.h>
#include<conio.h>
int main()
{
int i,j,k,l;
clrscr();
printf("\n HERE IS YOUR PATTERN:\n");
l=11;
for(i=1;i<=6;i++)
{
for(j=1;j<=i;j++)
{
if(j%2==0)
printf(" 0");
else
printf(" 1");
}
for(k=1;k<=l;k++)
printf("  ");


for(j=1;j<=i;j++)
{
if(j%2==0)
printf(" 0");
else
printf(" 1");
}
printf("\n");
l=l-2;
}
for(i=1;i<=13;i++)
{
if(i%2==0)
printf(" 0");
else
printf(" 1");
}
printf("\n");
l=1;
for(i=6;i>=1;i--)
{
for(j=1;j<=i;j++)
{
if(j%2==0)
printf(" 0");
else
printf(" 1");
}


for(k=1;k<=l;k++)
printf("  ");


for(j=1;j<=i;j++)
{
if(j%2==0)
printf(" 0");
else
printf(" 1");
}
printf("\n");
l=l+2;
}


getch();
return(0);
}







 Thanks Friends....

Thursday, May 17, 2012

C Program That Print Digit 7

Hello friends today i'sharing an interesting program with all of you, i'm sure that you really enjoy it because it is very simple and here i'm using simple concepts of c language.

77777777777
         7
        7
       7
      7
     7
    7
   7
  7
 7
7
#include<stdio.h>
#include<conio.h>
int main()
{
 int i,j,k,l;
 clrscr();
 printf("\n HERE IS YOUR PATTERN:\n\n\n");
 printf("\t\t");
 for(i=1;i<=11;i++)
  printf("7");
  printf("\n");
 l=9;
 for(i=1;i<=10;i++)
 {
  printf("\t\t");
  for(k=1;k<=l;k++)
   printf(" ");
  printf("7");
  printf("\n");
  l--;
 }
 getch();
 return(0);
}




Thanks Friends......

Tuesday, May 15, 2012

C Program That Print The Left Angle Triangle Using Alphabets.

Hello friends today i'm sharing an interesting program with all of you,i hope you can understand this code.In this pattern i'm using simple concepts of c language,Just go through it.


A
Z
B   C
Y   X
D   E   F
W   V   U
G   H   I   J
T   S   R   Q
K   L   M   N   O


#include<stdio.h>
#include<conio.h>
int main()
{
 int i,j,l,m;
 clrscr();
 printf("\n HERE IS YOUR PATTERN:\n");
 l=65;
 m=90;
 for(i=1;i<=5;i++)
 {
  for(j=1;j<=i;j++)
  {
   printf("  %c",l++);
  }
  printf("\n");
  for(j=1;j<=i;j++)
  {
   if(i==5)
    printf(" ");
   else
    printf("  %c",m--);

  }
  printf("\n");
 }
 getch();
 return(0);
}



 Thanks Friends......

C Program That Print The Patterns Using Fibonacci Sequence

Hello friends today i'm sharing an interesting program,please read this code i make this code very easy to all of you,it really helps you,i used only a simple concepts of c language.

0
1 1
2 3 5
8 13 21

#include<stdio.h>
#include<conio.h>
int main()
{
 int i,j,a=0,b=0,c=1;
 clrscr();
 printf("\n HERE IS YOUR PATTERN:\n\n");
 for(i=1;i<=4;i++)
 {
  for(j=1;j<=i;j++)
  {
   if(i==1 &&j==1)
    printf(" 0");
   else if(i==4 && j==4)
    printf("  ");
   else
   {

    printf(" %d",c);
    a=b;
    b=c;
    c=a+b;
   }
  }
  printf("\n");
 }
 getch();
 return(0);
}



    Thanking You Friends...

Popular Posts