Theme images by Storman. Powered by Blogger.

Featured Posts

Wednesday 4 January 2017

Basic Html Code

- No comments

 Basic Html Code

 

Hai Friends On The  Way to learning HTML  Every Person Should Learn Basic Html Code .Dont Worry Iam Here To Share Some Information

           <!DOCTYPE html>
           <html>
           <head>
           <title>Page Title</title>
           </head>
           <body>
           <h1>My First Heading</h1>
           <p>My first paragraph.</p>
           </body>
           </html>

Explonation:

    The <!DOCTYPE html> declaration defines this document to be HTML5
    The <html> element is the root element of an HTML page
    The <head> element contains meta information about the document
    The <title> element specifies a title for the document
    The <body> element contains the visible page content
    The <h1> element defines a large heading
    The <p> element defines a paragraph
 

Html Tags Explonaion 

    HTML tags normally come in pairs like <p> and </p>
    The first tag in a pair is the start tag, the second tag is the end tag
    The end tag is written like the start tag, but with a forward slash inserted        before the tag name 

Html Introduction

- No comments

Html  Introduction

 

HyperText Markup Language (HTML) is the standard markup language for creating web pages and web applications.

With Cascading Style Sheets (CSS), and JavaScript, it forms a triad of cornerstone technologies for the World Wide Web.

Web browsers receive HTML documents from a webserver or from local storage and render them into multimedia web pages.

HTML describes the structure of a web page semantically and originally included cues for the appearance of the document.

HTML elements are the building blocks of HTML pages. With HTML constructs, images and other objects, such as interactive forms may be embedded into the rendered page.

It provides a means to create structured documents by denoting structural semantics for text such as headings, paragraphs, lists, links, quotes and other items.

 HTML elements are delineated by tags, written using angle brackets.
Tags such as <img /> and <input /> introduce content into the page directly. Others such as <p>...</p> surround and provide information about document text and may include other tags as sub-elements.

Browsers do not display the HTML tags, but use them to interpret the content of the page.

HTML can embed programs written in a scripting language such as JavaScript which affect the behavior and content of web pages.

Inclusion of CSS defines the look and layout of content. The World Wide Web Consortium, maintainer of both the HTML and the CSS standards, has encouraged the use of CSS over explicit presentational HTML since 1997

Friday 26 August 2016

Program for to check Armstrong number or not.

- No comments

Armstrong number

An Armstrong number of three digits is an integer such that the sum of the cubes of its digits is equal to the number itself. For example, 371 is an Armstrong number since 3**3 + 7**3 + 1**3 = 371.

 Program for to check Armstrong number or not.

int main()
{
    int number, originalNumber, remainder, result = 0;

    printf("Enter a three digit integer: ");
    scanf("%d", &number);

    originalNumber = number;

    while (originalNumber != 0)
    {
        remainder = originalNumber%10;
        result += remainder*remainder*remainder;
        originalNumber /= 10;
    }

    if(result == number)
        printf("%d is an Armstrong number.",number);
    else
        printf("%d is not an Armstrong number.",number);

    return 0;
}

Output:

Enter an integer: 1634
1634 is an Armstrong number.

Another Example

Program for to check Armstrong number or not

 

#include <stdio.h>
#include <math.h>

int main()
{
    int number, originalNumber, remainder, result = 0, n = 0 ;

    printf("Enter an integer: ");
    scanf("%d", &number);

     originalNumber = number;
   
    while (originalNumber != 0)
    {
        originalNumber /= 10;
        ++n;
    }

    originalNumber = number;

    while (originalNumber != 0)
    {
        remainder = originalNumber%10;
        result += pow(remainder, n);
        originalNumber /= 10;
    }

    if(result == number)
        printf("%d is an Armstrong number.", number);
    else
        printf("%d is not an Armstrong number.", number);

    return 0;
}


 

C++ Identifiers

- No comments
C++has strict rules for variable names. A variable name is one example of an identifier.  An identifier is a word used to name things. One of the things an identifier can name is a variable.We will see in later chapters that identifiers name other things such as functions and classes.  Identifiers have the following form:

  • Identifiers must contain at least one character.
  •  The first character must be an alphabetic letter (upper or lower case) or the underscore
               ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_ 
  • The remaining characters (if any) may be alphabetic characters (upper or lower case), the underscore,or a digit
                                    ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_0123456789
  •  No other characters (including spaces) are permitted in identifiers 
  • A reserved word cannot be used as an identifier

Here are some examples of valid and invalid identifiers:

  • All of the following words are valid identifiers and so qualify as variable names:
    x,x2,total,port_22, and FLAG
C++ Identifiers

This table .C++ reserved words. C++reserves these words for specific purposes in program construction. None of the words in this list may be used as an identifier; thus, you may not use any of these words to name a variable.
 

Saturday 20 August 2016

Compile & Execute C++ Program

- No comments

 Let's look at how to save the file, compile and run the program. 

Please follow the steps given below:

  • Open a text editor and add the code as above.
  • Save the file as: hello.cpp
  • Open  a  command  prompt  and  go  to  the  directory  where  you  saved  the file.

  • Type 'g++ hello.cpp' and press enter to compile your code. If there are no errors  in  your  code  the  command  prompt  will  take  you  to  the  next  line and would generate a.out executable file.

  • Now, type 'a.out' to run your program.
  • You will be able to see ' Hello World ' printed on the window
       $ g++hello.cpp
       $ ./a.out
       HelloWorld
  • Make sure that g++ is in your path and that you are running it in the directory containing file hello.cpp

C++ Program Structure

- No comments

Let us look at a simple code that would print the words Hello World


#include<iostream>
usingname space std;
// main() is where program execution begins.
int
main()
{
       cout <<"Hello World";
       // prints Hello World

       return 0;
}


Explanation:- 

  • The  C++  language  defines  several  headers,  which  contain  information that is either necessary or useful to your program. For this program, the header<iostream>is needed
  • The   lineusing   namespace   std;tells   the   compiler   touse   the   std namespace. Namespaces are a relatively recent addition to C++
  • The  next  line ‘//  main()  is  where  program  execution  begins.’is  a single-line comment available in C++. Single-line comments begin with // and stop at the end of the line.


  • The line int main()is the main function where program execution begins.
  • The  next  linecout  <<  "This  is  my  first  C++  program.";causes  the message "This is my first C++ program" to be displayed on the screen.
  • The next linereturn 0;terminates main()function and causes it to return the value 0 to the calling process

Wednesday 17 August 2016

Uses of C++

- No comments

uses of c++

Use of C++:

  • C++  is  used  by  hundreds  of  thousands  of  programmers  in  essentially  every application domain.
  • C++ is being highly used to write device drivers and other softwarethat rely on direct manipulation of hardware under realtime constraints.
  • C++  is  widely  used  for  teaching  and  research  because  it  is  clean  enough  for successful teaching of basic concepts.
  • Anyone  who  has  used  either  an  Apple  Macintosh  or  a  PC  running  Windows  has indirectly  used  C++  because  the  primary  user  interfaces  of  these  systems  are written in C++ 
  • The most important thing while learning C++ is to focus on concepts.
  • The  purpose  of  learning  a  programming  language  is  to  become  a  better programmer;  that  is,  to  become  more  effective  at  designing  and  implementing new systems and at maintaining old ones.
  • C++  supports  a  variety  of  programming  styles.  You  can  write  in  the  style  of Fortran,  C,  Smalltalk,  etc.,  in  any  language.  Each  style  can  achieve  its  aims effectively while maintaining runtime and space efficiency.