Wednesday, July 8, 2015

Basic of C


C Language – The C language is one of the powerful programming languages used to write computer programs for variety of applications. It was developed by Dennis Ritchie at Bell Lab during 1970’s. C has flexible features to write programs for numerical, commercial and graphical applications. May operating system programs for the latest computers and compilers are written using C language.
                        This language was developed from B language which was modified from a language called Basic Combined Programming Language (BCPL).

Salient features of C:
C is a general purpose, structured programming language. Among the two types of programming languages discussed earlier, C lies in between these two categories. That’s why it is often called a middle level language. It means that it combines the elements of high level languages with the functionality of assembly language. It provides relatively good programming efficiency (as compared to machine oriented language) and relatively good machine efficiency as compared to high level languages). As a middle level language, C allows the manipulation of bits, bytes and addresses – the basic elements with which the computer executes the inbuilt and memory management functions. C code is very portable, that it allows the same C program to be run on machines with different hardware configurations. The flexibility of C allows it to be used for systems programming as well as for application programming.

C is commonly called a structured language because of structural similarities to ALGOL and Pascal. The distinguishing feature of a structured language is compartmentalization of code and data. Structured language is one that divides the entire program into modules using top-down approach where each module executes one job or task. It is easy for debugging, testing, and maintenance if a language is a structured one. C supports several control structures such as while, do-while and for and various data structures such as strucs, files, arrays etc. as would be seen in the later units. The basic unit of a C program is a function - C’s standalone subroutine. The structural component of C makes the programming and maintenance easier.


Characters used in C –
·         Alphabets
Upper case letters A to Z
Lower case letter a to z

·         Numbers
0 to 9

·         Special Characters

+
Plus
Double Quote
-
Minus
&
Ampersand
*
Asterisk
#
Hash
/
Slash
$
Dollar
\
Back slash
^
Caret
%
Percent
< 
Lesser than
|
Vertical bar
> 
Greater than
~
Tilde
=
Equal to
?
Question mark
(
Open Parenthesis
!
Exclamation Mark
)
Close Parenthesis
,
Comma
[
Open bracket
.
Full stop
]
Close Bracket
;
Semicolon
{
Open Set Bracket
:
Colon
}
Close Set bracket
Apostrophe
_
Underscore

Identifier –An identifier is a name having a few letters, numbers and special character _ (Underscore). It is used to identify a variable, function, symbolic constant and so on. An identifier can be written with a maximum 31 characters. It is a good practice to have identifiers with few letters; less than 8 letters is commonly followed with the first letter being an alphabet.
Ex:-
            c3
            sum
            PI
            sigma
            matadd

Rules for Forming Identifiers -
Identifiers are defined according to the following rules:
1.      It consists of letters and digits.
2.      First character must be an alphabet or underscore.
3.      Both upper and lower cases are allowed. Same text of different case is not equivalent, for example: TEXT is not same as text.
4.      Except the special character underscore ( _ ), no other special symbols can be used.

Keywords or Reserved words – C language uses the following keywords which are not available to users to use them as variables/function names. Generally all keywords are in lower case although uppercase of same names can be used as identifiers.
auto
break
case
enum
volatile
while
char
extern
switch
typedef
const
struct
short
union
continue
return
signed
unsigned
register
goto
sizeof
void
for
if
static
float
double
int
default
do
else
long

Tokens – There are six types of tokens are used in C language.

C Tokens
Examples
Keywords
Auto, float, int etc
Constants
-25, 3.24 etc
Identifiers
Sum, PI etc
String literals
“Total Amount is” “Sum =“ etc
Operators
+, -, * etc
Separators
,   :    ;

Watch Video Tutorial Click Below 






Like it ? Share it.

Tuesday, July 7, 2015

Compiler and How to install


A Compiler is used to translate a C program into object program using which an executable program (.EXE) will be generated by linking the input (keyboard) and output(Monitor) devices. The .EXE file will be run to get the result. Different C compilers are used in DOS and UNIX environments. We know that an editor is used to type and save a program in disk. In DOS environment C compiler with the TURBO editor is commonly available. In UNIX operating system a built-in editor Vi is commonly used.

                        All the UNIX systems have a C compiler called cc. It is a command line compiler and is used to generate the executable file.

We will use Code Block for this Tutorial series. This is an alternate option of Turbo C.

How to install Code Blocks

1. Open your Web Browser and search for Code Blocks in Google then open official website of Code Blocks


2. After opening official click on download tab then click on download the binary release


3. Scroll down and click on sourceforge download link (2nd link)


4. Wait for a while your download will be start automatically


5.  As I am using Internet Download Manager so this is a dialogue box of IDM for downloading the file. (if you do not use any download manager then your browser will use the default downloader)


6. Find out your downloaded file and right click on the code blocks setup file then open it


7. Click Next


8. Click I Agree


9. Click Next


10. Click Install


11. Installation on process


12. If you want to run code blocks now click on yes or if you do not wish to run now then click no


13. If you choose Yes then Code Blocks will be open


14. Code Blocks


15. Click Next


16. Click Finish
(Click image for large view)


Watch Video Tutorial Click Below



Like it ? Share it.

Monday, July 6, 2015

How to Register a Domain in Godaddy


GoDaddy is a publicly traded Internet domain registrar and web hosting company. As of 2014, GoDaddy was said to have had more than 59 million domain names under management, making it the world's largest ICANN-accredited registrar. It serves more than 12 million customers and employs more than 4,000 people.

1. Open your web browser then go to www.godaddy.com


2. Click Sign in button then choose either New Customer or Sign in. If you do not have any registered email id in godaddy then Click on Create My Account or if you have already registered email ID then write your username and password and click Sign inbutton.



3. Fill the sign up form and click on Create Account.


4. This is a survey, simply click No thanksand bypass it.


5.  Now click on Domain then click on Domain Search.


6. Type your website and click on Searchbutton if your website name is still available then you are lucky. If it is showing unavailable then try again with a different website name.


7. Click Select


8. Click Continue to Cart


9. In this screen you will see some other stuff like do you want privacy for your website etc if you do not want anything simply click on Continue to cart.


10. Now this screen shows that how much exactly you need to pay for this domain. However, you can apply Promo codesto reduce the domain price. Now click on Proceed to Checkout.


11. Fill the billing information and come to the Payment information section, in this section you need to select your payment mode like in this example I am going to select Net Banking. After selecting Payment Mode click Continue.


12. Check your billing information and check I agree T&C box then click on Place your order.


13. Now select your Payment mode again, in this example I am going to select Net Banking then choose your Bank Name. You can uncheck the box which says “Save your bank name with CCAvenue checkout for future payments. What is it exactly? CCAvenue wants to save your bank name in their own database for boosting up your payment mode. It means when you will pay for another domain you do not need to select your bank name that’s it. Now Click on Make Payment.


14. As you can see now it redirected us to SBI online banking website so now simply login with your net banking ID and password and make payment.


15. Done





Like it ? Share it.

Sunday, July 5, 2015

Introduction to Programming



Computer Programming– A program has a set of instructions written in correct order to get the desired result. The method of writing the instructions to solve the given problem is called programming.

Programming languages can be divided into two categories:

(i)                Low Level Languages or Machine Oriented Languages: The language whose design is governed by the circuitry and the structure of the machine is known as the Machine language. This language is difficult to learn and use. It is specific to a given computer and is different for different computers i.e. these languages are machine-dependent. These languages have been designed to give a better machine efficiency, i.e. faster program execution. Such languages are also known as Low Level Languages. Another type of Low-Level Language is the Assembly Language. We will code the assembly language program in the form of mnemonics. Every machine provides a different set of mnemonics to be used for that machine only depending upon the processor that the machine is using

(ii)             High Level Languages or Problem Oriented Languages: These languages are particularly oriented towards describing the procedures for solving the problem in a concise, precise and unambiguous manner. Every high level language follows a precise set of rules. They are developed to allow application programs to be run on a variety of computers. These languages are machine-independent. Languages falling in this category are FORTRAN, BASIC, PASCAL etc. They are easy to learn and programs may be written in these languages with much less effort. However, the computer cannot understand them and they need to be translated into machine language with the help of other programs known as Compilers or Translators.

Programming techniques: - There are two type of programming techniques commonly used:-
1.      Procedural Programming
2.      Object Oriented Programming (OOP)

Procedural Programming– In Procedural Programming, for a given problem, variables are identified and instructions are written using the variables in the correct sequence to get the required result.
                        The procedural Programming method is commonly used to solve scientific and engineering problem involving variables.

Object Oriented Programming (OOP)– In Object Oriented Programming, Objects which have data related to a person or item are used. The program can be written using many functional blocks. The functional block contains instructions similar to procedural programming.
                        Object Oriented Programming method is commonly used to develop software packages. C++ is one of the commonly used object oriented programming languages.

Algorithm – In order to write computer programs without any logical errors, it is recommended programmers prepare a rough writing showing the steps involved in the program. This is called an algorithm.
                        An algorithm presents step by step instructions required to solve any problem. These steps can be shown diagrammatically using a flowchart.


Flowchart – Flowchart is a symbolic or diagrammatic representation of an algorithm. It uses several geometrical figures to represent the operations, and arrows to show the direction of flow. Following are the commonly used symbols in flowcharts:-

(Click on image for large view)


Question – Answer

Q. 1 Write the algorithm and draw the flowchart to find the sum and product of given two numbers.

Solution:

            In this problem, two numbers, Let A and B, are given (input) and the result, sum (A+B) of two numbers and product (A*B) of two numbers, are to be calculated.

Algorithm:
1.      Read a, b
2.      Sum ← a+b
3.      Product ←a*b
4.      Print sum, product
5.      Stop

Flowchart:

Note – We can use equal to (=) sign instead of arrow (←). E.g. sum = a+b

Video Tutorial Click Below:



Like it ? Share it.

Thursday, July 2, 2015

Reliance Unlimited 3G Trick


Today i am going to tell you how to use Reliance Unlimited 3G at very low cost. This is an USSD process of activation Reliance 3G.

How to Activate:
  1. There should be balance in your main account.
  2. Dial *129*2# after dialing this code you will receive a Message "Recharge of Rs. 9 Successful Enjoy 1GB 2G Data Unlimited Whatsapp Facebook Twitter. Valid for Today"
     
  3. Rs. 9 will deduct from your main account balance.
     
  4. Repeat above USSD code and each activation will give you 1 GB Data. So if you want 10 GB Data then you need to dial above code 10 times as well Rs. 90 will be deduct.
  5. Now Dial *129# then reply with 7 for more option again reply with 1 for 100 MB @ Rs. 9 3G Data activation. Remember Rs. 9 will be deduct again from your main account.
     
  6. Wait for a while and restart your Mobile/Device.
  7. Done
Term Condition:
  1. This is not an official plan so you should not ask customer care executive about this otherwise they will fix this bug and our enjoyment will be vanish.
  2. There Should be Balance its unlimited but not free.
  3. Validity will be only 1 Day till 12 AM.
  4. You can not blame anyone if this trick is not working for you.
  5. Enjoy it silently 



Like it ? Share it.

Thursday, June 18, 2015

Input Statement (cin) in C++



cin (console input) –  It is used to read/input value of variables from the keyboard.
Syntax :-
cin >> variable_name;
Ex: -
cin >> a;
where >>is known as extraction or get from operator.

  cin >> a
  where a is variable.



Tuesday, May 12, 2015

Output Statement (cout) in C++


cout (console output) –  It is used to print/display value of variable.
Syntax:-
cout << variable_name;
cout << “Any Message”;

Ex: -
cout << a;
cout << “Hello World”;

where << is known as insertion or put to operator.

  cout << “Any Message”
  cout << a
where a is variable and Any message is string