What is diffrance between declaration and defination of a variable or function
Answers were Sorted based on User's Feedback
Answer / deepak mundhada
1 when we declare a variable it gets memory allocated at
stack in ram.
definition means we are assigning value to that variable.
2 address of variable can be changed but address cant be
changed.
Is This Answer Correct ? | 4 Yes | 0 No |
Answer / r.ramakrishna
Declaration means allocating memory for the variable.
Definition means defining address of the variable in a class.
Is This Answer Correct ? | 3 Yes | 1 No |
Answer / nagarjuna reddy
once a variable is defined it'l never change through entire
program.
but declaration of a variable can be changed as per our
requirement.
Is This Answer Correct ? | 3 Yes | 1 No |
Answer / manish soni bca 3rd year jaipu
IN FUNCTION;
-------------------------------------------
1:)DECLARE: int sum(int);//close with semicolon;
2:)DEFINATION: int sum(int n)//not colse with semicolon;
{
//logic of the function;
}
Is This Answer Correct ? | 2 Yes | 0 No |
Hi, main() { } Is a user defined function or Built in Functionn
Write a C program that computes the value ex by using the formula ex =1+x/1!+x2/2!+x3+3!+………….
Determine the code below, tell me exactly how many times is the operation sum++ performed ? for ( i = 0; i < 100; i++ ) for ( j = 100; j > 100 - i; j--) sum++;
write a program to find lcm and hcf of two numbers??
what is the difference b/w compiler and debugger?
Write a pro-gramme to determine whether the number is even or odd?
How many loops are there in c?
can we declare a function inside the structure? ex: struct book { int pages; float price; int library(int,float); }b; is the above declaration correct? as it has function declaration?
What are the c keywords?
Write a program to print distinct words in an input along with their count in input in decreasing order of their count
Given an array of numbers, except for one number all the others occur twice. Give an algorithm to find that number which occurs only once in the array.
1. Write a C program to count the number of occurrence of a specific word in the given strings. (for e.g. Find how many times the word “live” comes in the sentence “Dream as if you’ll live forever, live as if you’ll die today ”)