Friday, September 18, 2015

RULE OF IDENTIFIER


RULE OF IDENTIFIER
1.   First character must be an alphabet or underscore.
2.   Must consist of only letter, digit or underscore.
3.   Only first 31 characters are significant.
4.   Cannot use a keyword.
5.   Must not contain white space.

Thursday, September 17, 2015

VARIABLE LIFE CYCLE


        Variable is container. It contains value according to data type.
        Variable Life Cycle.
        1. Declaration of the identifier.
        2. Initialize value inside the identifier.
        3. Perform some operation. (According to question)
        4. Print identifier value.
      

        Syntax for (1) Identifier Declaration
        <data type> <space> <identifier name >;
        Example:-
        int roll;

        Syntax for (2) Initialize value inside the identifier.
        <identifier> <assignment operator> <value >;
        Example:-
        roll=1001;
        Syntax for (4) Print identifier value.
        <name of the output function > <("<format specifier>", <identifier as a argument >)>;
        Example: -
        printf("%d",roll);
        Syntax for (4) Print identifier value with message.
        <name of the output function> <("<message><format specifier>",<identifier as a argument>)>;
        Example:-
        printf("Roll=%d",roll);
        .........................................................................................................
       

To declare more than one variable with same data then use comma operator to separate each identifier.
        Syntax for - More than one variable with same data type.
        <data type> <space> <identifier><comma><identifier><comma> ................ ;
        Example: -
        int fnumber,snumber;
        To print more than one identifier value
        syntax:-
      <name of the output function> <("<format specifier><format specifier>",<identifier as a argument><identifier as a argument>)>;
        Example: -
                     printf("Fnumber=%d\nSnumber=%d",fnumber,snumber);

Monday, January 3, 2011

#include
#include
# include
void main()
{
int i,j,f,att,a,b=0,c,d;
char g,h,n,pass[50]="1234";
clrscr(); p:
printf("\n enter the password");
for(i=0;pass[i]!='\0';i++);
for(f=0,j=0;j {
g=getch();
printf("*");
if(g!=pass[j])
f=1;
if(f==0)
{
clrscr();
printf("\n welcome to the program");
printf("\n enter the no : ");
scanf("%d",&a);
printf("\n press 1 for reverse");
printf("\n press 2 for palindrome");
printf("\n press 3 for armstrong ");
printf("\n press 4 for exit");
fflush(stdin); scanf("%c",&n);
if(n=='1')
{
while(a>0)
{
c=a%10;
b=(b*10)+c;
a=a/10;
}
printf("\nreverse=%d",b);
}
if(n=='2')
{
d=a;
while(a>0)
{
c=a%10;
b=(b*10)+c;
a=a/10; \
}
if(b==d)
printf("\n palindrome");
else printf("\n not palindrome");
}
if(n=='3')
{
d=a;
while(a>0)
{
c=a%10;
b=b+c*c*c;
a=a/10;
}
if(b==d)
printf("\n armstrong");
else
printf("\n not armstrong");
}
if(n=='4')
{
exit(0);
}
}
else
printf("\n invalid passward");
printf("\ndo u want to try again");
printf("\n press y/n : ");
fflush(stdin);
scanf("%c",&h);
att=1;
while(h=='y')
{
if(att<=3)
{
printf("\n renter the passward");
att++;
goto p;
}
else
printf("sorry ur passwad doesn't match");
}
getch();
}

Friday, August 20, 2010

What is Language?

Language is medium of communication.

What is Program?

Set of statement and instruction written in any computer language that can execute on computer is called program.

What is Software?

Set of Program to develop program, set of related job is called sotfware.

There are two type of software.

1. System Software : - The software that can directly interact with hardware is called system software.

2. Application Software: - The software that can not directly interact with hardware. It is interact with system software.

How many type of computer component.

Five type of computer component

1. Hardware (Hardware is a physical existance)
2. Software (Software is logical existance component)
3. Process
4. Algorithm (The way of work)
5. User