Thursday, 16 January 2014

What is a register variable

What is a register variable

Register variables are stored in the CPU registers. Its default value is a garbage value. Scope of a register
variable is local to the block in which it is defined. Lifetime is till control remains within the block in which the
register variable is defined. Variable stored in a CPU register can always be accessed faster than the one that isstored in memory. Therefore, if a variable is used at many places in a program, it is better to declare its storage class as register

Example:

register int x=5;
Variables for loop counters can be declared as register. Note that register keyword may be ignored by some
compilers.

What is a static variable in c

What is a static variable

A static variable is a special variable that is stored in the data segment unlike the default automatic variable thatis stored in stack. A static variable can be initialized by using keyword static before variable name.
Example:

static int a = 5;

A static variable behaves in a different manner depending upon whether it is a global variable or a local variable.A static global variable is same as an ordinary global variable except that it cannot be accessed by other files in the same program / project even with the use of keyword extern. A static local variable is different from local variable. It is initialized only once no matter how many times that function in which it resides is called. It may be
used as a count variable.
Example:
#include <stdio.h>
//program in file f1.c
void count(void) {
static int count1 = 0;
int count2 = 0;
count1++;
count2++;
printf("\nValue of count1 is %d, Value of count2 is %d", count1, count2);
}/
*Main function*/
int main(){
count();
count();
count();
return 0;
}
Output:
Value of count1 is 1, Value of count2 is 1
Value of count1 is 2, Value of count2 is 1

What is the difference between declaring a variable and defining a variable in c language

What is the difference between declaring a variable and defining a variable?

Declaration of a variable in C hints the compiler about the type and size of the variable in compile time. Similarly,
declaration of a function hints about type and size of function parameters. No space is reserved in memory for
any variable in case of declaration.

Example: int a;

Here variable 'a' is declared of data type 'int'
Defining a variable means declaring it and also allocating space to hold it.
We can say "Definition = Declaration + Space reservation".

Example: int a = 10;

Here variable "a" is described as an int to the compiler and memory is allocated to hold value 10.

WHAT IS DATA TYPE IN C LANGUAGE

Data types:

 Data types indicate the types of data a variable can have. A data types usually define a set of values, which can be stored in the variable along with the operations that may be performed on those values. C includes two types of data.
* Simple or Fundamental data type
* Derived data type

Simple Data Types:

 There are four simple data types in C.
* int
* char
* float
* double

int:- 

This means that the variable is an integer are stored in 2 bytes, may range from -32768 to 32767.

char:-

 This means that the variable is a character type, char objects are stored in one byte. If unsigned, the values may be in the range 0 to 255.

Float:-

 This means that the variable is a real number stored in 4 bytes or 32 bits. The range of floating point values are between 3.4E-38 to 3.4E38 or 6 significant digits after the decimal point.

Double:

 This means that the variable is a double precision float type. In most cases the systems allocates 8 bytes or 64 bits space, between 1.7E-308 to 1.7E308.

Derived Data Types:

 Derived data types are constructed from the simple data types and or other derived data types. Derived data include arrays, functions, pointers, references, constants, structures, unions and enumerations.

what is Variables in c language

Variables:

 A variable is an object or element that may take on any value or a specified type. Variable are nothing but identifiers, which are used to identify variables programming elements. Eg: name, sum, stu_name, acc_no etc.

SSC10TH RESULT 2014

               AP SSC / 10th result 2014

***
BSEAP Released AP 10th Class Advanced Supple Results 2014 at Board of SSC Website ....

Andhra Pradesh State Board of Secondary Education (BSEAP) will going to announced the 10th Class  Results 2014 on 12th July 2014 . The State Deirectorate of Government Examinations was announced the AP SSC/ 10th Class Supple Results 2014 Released Schedule in a Press Note on 11th July 2014 .The Board of Secondary Education Advanced Supplementary Examination Test Results will Decleared through online from the following listed Websites and the SSC / AP 10th Supple Results 2014 Download available after 4:30 Pm Today ..

who are attend to the AP 10th Class Advanced Supple Examination tests the Candidates will Download their Results with Submitting their Hall Ticket Number at the AP 10th Supple Results 201 Download Page from the Listed Websites and you will Download Directlt the AP SSC/10th Results Bellow Direct Link in the Table...

Note : AP 10th Supple Results 2014 Subject Wise Grades or AP SSC Results 2014 Subject Wise Marks Download Available at Nearest E-Seva , Meseva or AP Online Centers only ..
http://www.manabadi.com
http://www.schools9.com
http://results.cgg.gov.in/
http://www.manachaduvu.com/
http://www.schools9.com/
http://bseap.cgg.gov.in/
http://www.sakshieducation.com/
http://www.eenaduprathibha.net/
www.pratibhaplus.com,
www.vidyavision.com,
www.bharatstudent.com,
www.results.educationandhra.com,
www.99results.com,
Download BSEAP 10th Supple Results 2013
AP SSC/10th Advanced Supple Results Download Available from 12th July 4:30 PM
***

C Language Components


C Language Components

The four main components of C language are
1) The Character Set.
2) Tokens
3) Variables
4) Data Types


1) The Character Set :


 Character set is a set of valid characters that a language cab recognize. A character represents any letter, digit or any other sign.

* Letters           - A,B,C……Z or a,b,c …………z.

* Digits        -      0,1…………9

* Special Symbols        -      ~!@#$%^&.........

* White Spaces        -        Blank space, horizontal tab, carriage return,
new line, form feed.


2) Tokens: 

The smallest individual unit in a program is known as a token.
C has five tokens

i. Keywords
ii. Identifiers
iii. Constants
iv. Punctuations
v. Operators


i. Keywords:

 Keywords are reserved word in C. They have predefined meaning cannot changed. All keywords must be written in lowercase. Eg:- auto,long,char,short etc.

ii. Identifiers: -

 Identifiers refer to the names of variable, functions and arrays. These are user-defined names. An identifier in C can be made up of letters, digits and underscore. Identifiers may start with either alphabets or underscore. The underscore is used to make the identifiers easy to read and mark functions or library members.

iii. Constants: -

 Constants in C refers to fixed values that do not change during the execution of a program. C support several types of constants.
a. Numerical Constants
i. Integer Constant
1. Decimal Constant
2. Octal Constant
3. Hexadecimal Constant
ii. Float Constant
b. Character Constants
i. Single Character Constant
ii. String Constant

Integer Constant: -

 An integer constant is a whole number without any fractional part. C has three types of integer constants.
Decimal Constant: - Decimal integers consists of digits from 0 through 9
Eg.: 34,900,3457,-978

Octal Constant: -

 An Octal integer constant can be any combination of digits from 0 through 7. In C the first digit of an octal number must be a zero(0) so as to differentiate it from a decimal number. Eg.: 06,034,-07564

Hexadecimal Constant:

 Hexadecimal integer constants can be any combination of digits 0 through 9 and alphabets from „a‟ through „f‟ or „A‟ through „F‟. In C, a hexadecimal constant must begin with 0x or 0X (zero x) so as to differentiate it from a decimal number. Eg:- 0x50,0XAC2 etc

Floating Constants (Real):

 Real or floating point numbers can contain both an integer part and a fractional part in the number. Floating point numbers may be represented in two forms, either in the fractional form or in the exponent form.
A float point number in fractional form consists of signed or unsigned digits including decimal point between digits. E.g:- 18.5, .18 etc.
Very large and very small numbers are represented using the exponent form. The exponent notation use the „E‟ or „e‟ symbol in the representation of the number. The number before the „E‟ is called as mantissa and the number after forms the exponent.
Eg.:-5.3E-5,-6.79E3,78e05

Single Character Constant: -

 A character constant in usually a single character or any symbol enclosed by apostrophes or single quotes. Eg.: ch=‟a‟
String Constant: - A sequence of character enclosed between double quotes is called string constant. Eg.: “Hello Good Morning”

iv) Punctuations: -

 23 characters are used as punctuations in C. eg: + _ / ; : > ! etc

v) Operators: -

 An operator is a symbol that tells the computer to perform certain mathematical or logical manipulation on data stored in variables. The variables that are operated as operands. C operator can be classified into 8 types.
i. Arithmetic Operators : + - * / %
ii. Assignment Operators : =
iii. Relational Operators: < > <= >= == !=
iv. Logical Operators:! && ||
v. Conditional Operators: ! :
vi. Increment & Decrement Operator : ++ --
vii. Bitwise Operator:! & | ~ ^ << >>
viii. Special Operator :