Thursday, 6 December 2012

Palindrome program | logic | examples source code | c++

Palindrome  program | logic | examples source code | c++

After reversing if  you are getting same  number it means you are reversing palindrome number.
to reverse the all digit and get same number is symbol of palindrome number.
Lets take examples
121  after reverse it  we will get 121. so we can say 121 is palindrome number.same is with 999=999.
12=21 not palindrome number .Have you seen mirror same functionality is working here.
But here is digit not your  face.so we are going to learn about palindrome number and execution.
we  can reverse string also like did=reverse(did)=did but i dont know about  words just think about digits .ok i think there is enough explanation now time is to do something real .
Let's concentrate to source code in c program.sorry about c language we are going to learn c++.everything is same in c just little about scanf and printf

How to write c++ palindrom number Program with source code


int pali(int);  // function name pali
void main()
{
int n,a;
clrscr();
cout<<"\n enter the number=";
cin>>n;  // accepting number from user
a=palindrom(n);
if(n==a)  // cheking after reversing number is same or not
cout<<"\n number is palindrom";  // yes it is
else
cout<<"\n number is not palindrom";  //no  it is not
getch();
}
int palindrom(int x) //
{
int r,sum=0;
while(x!=0) // till number will there
{
r=x%10; taking mode so we can get at least one number

sum=sum*10+r;   //addition
x/=10; //division
}
return(sum);//function calling
}

in  c or c++ do execution with your own .execution will give you correct logic and method to understand program logic.

This application is currently offline. To enable the application, remove the app_offline.htm file from the application root directory.

This application is currently offline. To enable the application, remove the app_offline.htm file from the application root directory.

This application is currently offline. To enable the application, remove the app_offline.htm file from the application root directory.
  1. when error comes like this after executing  asp.net website.
  2. simple way to get rid of this problem is just remove app_offline.htm.
  3. how to remove app_offline.htm file  the question comes .
  4. whenever this query will comes just go to solution explorer and delete app_offline.htm file.
  5. after deleting that file just again refresh website and press F5 to run the program again.

Queristring in vb.net with example | how to use queristring in asp.net

Queristring in vb.net with example | how to use queristring in asp.net

how to use queristring in vb.net .
if we want to pass the information from one page to another IN  .aspx page
in c# or vb.net we need some object which will give flow of data from
one page to another page.so , that is session and queristring.
in this article we will learn how to use response.redirect  to pass data from one page to another page.
Response.Redirect("Default.aspx?from=" & txtfrom.Text & "  &to=" &
txtto.Text & " &last=" & txtlast.Text)
 queristring do same functionality in c# and vb but using syntax is little bit different.
in c# we use + sign whereas in vb we use & sign.
Response.Redirect("Default2.aspx?from=" & txtfrom.Text & "  &to=" &

txtto.Text & " &last=" & txtlast.Text)

above code shows that passing value from first default.aspx to
default2.aspx. where variable from is storing data of txtfrom text box
and to is storing txtto text box value .this value will go to the
default2.aspx where we can utilize that values.

so lets start page 2 default2.aspx.
 we can store from and to value in other variable for use purpose.
 Dim sr as integer
sr=from
Dim dr as integer
dr=to

and we can use it any where on same page .
but remember about  " " and & & sign . many developers like me find difficulties to solve this problem.

basic problem comes when we need to pass more than one paramater then we think about syntax  like where to use & and  '" and "","".
there are very small , simple and very useful think. so , do it very carefully. Don't play with it just work with it.


Tuesday, 4 December 2012

strcmp | How to check password in C with Break Statement and while

strcmp  |  How to check password in C with Break Statement and while

I don't have so much idea about its execution but at last its using strcmp to compare
original password and entered password by using f7 key you can get its idea .

#include<stdio.h> //initializing header files
#include<conio.h>
void main()
{
void pass();  // function name pass
clrscr();
pass();
printf("\n\nNow you can proceed...........\n");
getch();
}
void pass()
{
char ar[30],ch; //
int i=0;
printf("\n\nEnter password\n");
while(1)
{
ch=getch();
if(ch==13)
break;
else
{
ar[i]=ch;
i++;
printf("*");
}
}
ar[i]='\0';
if(strcmp(ar,"yourvalue")==0)
return;
else
{
printf("Invalid password try again\nPress any key to continu\n");
getch();
pass();
}
}

c program for positive (+ve)and negative(-ve) number | comments with source code example

c program for positive (+ve)and negative(-ve) number | comments with source code example

Positive number means number which is not negetive means number greater than 0 or equal to zero.
let's take example.
9 - 8=1
After subtracting 8 from 9 we will get out put =1 that is positive.
but if i will subtract 9 from 8 like 8 - 9= -1.
i will get out put like -1.
go to start -> run  -> calc .
it will open calci and then  you can calculate.or do any kind of calculation.so , in this program i am going to show  How to find out positive and negative number.
with comments in c program with source code.at last output.

#include<stdio.h>    //header files//
#include<conio.h>   //for clrscr//
main()
{                           //main start//
int user_number;       //declaration//
clrscr();                    //clear the screen//
printf("enter any number"); //taken number from user//
scanf("%d",&number);
//condition//

if(user_number>0)  //if user number is Greater than zero//
{
printf("\n the given number  is positive");
}

if(user_number<0) //if user number is Less than zero//
{
printf("\n the given number  is negetive");
}
getch();
}               //Let see the out-put
output is
enter any number 68
number  is positive

enter any number -56
a is negative