ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
info       Did you received any Funny E-Mails from your Friends and like to share with rest of our friends? Yeah!! you can post that stuff   HERE
Google
 
Categories  >>  Software  >>  Programming Languages  >>  C
 
 


 

 
 C interview questions  C Interview Questions
 C++ interview questions  C++ Interview Questions
 VC++ interview questions  VC++ Interview Questions
 Delphi interview questions  Delphi Interview Questions
 Programming Languages AllOther interview questions  Programming Languages AllOther Interview Questions
Question
what is the difference between declaration ,defenetion and 
initialization of a variable?
 Question Submitted By :: Anjeereddy
I also faced this Question!!     Rank Answer Posted By  
 
  Re: what is the difference between declaration ,defenetion and initialization of a variable?
Answer
# 1
declaration : int a; 
declaration means here a is declared as integer variable 
initialization : int a = 5;
initialization is whatever you have declared give that 
variable some value
definition : int a;
definition is whatever variable you have declared give it's 
datatype as here a is declared as integer variable
 
Is This Answer Correct ?    14 Yes 2 No
Siddiqui Mohd. Faisal
 
  Re: what is the difference between declaration ,defenetion and initialization of a variable?
Answer
# 2
declaration means you declare variable.
ex: int a;
defination means this integer type a variable take 2 byte 
memory space.
initialization means we initialize the value of integer a 
variable type. 
ex: int a=2;
in declaration we declare variable and variable type , in 
initialization we define the value and in defination we 
define the type of variable.
 
Is This Answer Correct ?    10 Yes 1 No
Nirmal Kumar Tailor
 
 
 
  Re: what is the difference between declaration ,defenetion and initialization of a variable?
Answer
# 3
A good example to illustrate this Question ges like this:

   Whenever we apply for a job the company declares that we 
have been selected. Similarly we declare a variable like 
 
    int emp;
         (here emp behaves as an employee).

   Then he will be assigned with a initial salary which 
will be incremented in course of time period or on 
experience basis.
        Similarly the variable int is assigned a initial 
value.
            i.e int emp=20; 
             (value can be changed in between program)

      The employee is now identified by his post, which can 
define his status in the company.
          Same way the variable is also defined in the 
program.
             ie. int emp;
 
Is This Answer Correct ?    3 Yes 0 No
Shabeer V C
 
  Re: what is the difference between declaration ,defenetion and initialization of a variable?
Answer
# 4
As i know.....
Definition is one which allocates memory.
Ex: int x;

Declaration never occupy any memory space.
Ex:Function prototype declarations such as....
    int func(int,int);

Initialization: If any variable assigned with some value at
time definition itself is called initialization.
Ex:int x=0;
 
Is This Answer Correct ?    8 Yes 0 No
Gg
 
  Re: what is the difference between declaration ,defenetion and initialization of a variable?
Answer
# 5
declaration : int a; 
declaration means here a is declared as integer variable 
initialization : int a = 5;
initialization is whatever you have declared give that 
variable some value
definition : int a;
definition is whatever variable you have declared give it's 
datatype as here a is declared as integer variable
 
Is This Answer Correct ?    0 Yes 0 No
Sakthi Sudhan
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
what is available in C language but not in C++?  1
What is the value of y in the following code? x=7;y=0; if(x=6) y=7; else y=1; TCS10
The differences between Windows XP and Windows Visa HCL7
how to create c progarm without void main()?  1
Tell us the difference between these two : #include"stdio.h" #include<stdio.h> define in detial.  4
what is the use of keyword volatile?? LG-Soft4
write an algorithm to get a sentence and reverse it in the following format: input : I am here opuput: Here Am I note: first letter of every word is capiatlised  2
What kind of sorting is this? SORT (k,n) 1.[Loop on I Index] repeat thru step2 for i=1,2,........n-1 2.[For each pass,get small value] min=i; repeat for j=i+1 to N do { if K[j]<k[min] min=j; } temp=K[i];K[i]=K[min];K[min]=temp; 3.[Sorted Values will be returned] A)Bubble Sort B)Quick Sort C)Selection Sort D)Merge Sort Accenture3
what is real time system?what is the differance between hard and soft real time systems  2
suppose we use switch statement and we intilize years name using enum statement like(jan,feb,mar,------dec) we take integer value as an input .question is that the month which we analyz is from 0 to 11 bt if i enter 12 than how he again starts from begning and print jan  1
Hai why 'c' is the middle language  2
What is the memory allocated by the following definition ? int (*x)(); ADITI2
How does C++ help with the tradeoff of safety vs. usability?  1
why java is called as a purely oops language.  2
what is the defrenece between structure and union  5
How can draw a box in cprogram without using graphics.h header file & using only one printf(); ? NIIT1
compute the nth mumber in the fibonacci sequence? TCS7
how many times of error occur in C  7
program to find the roots of a quardratic equation  1
any string of bits of length 'n' represents a unique non- negative integer between.............?  2
 
For more C Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com