Explain what is the difference between declaring a variable and defining a variable?



Explain what is the difference between declaring a variable and defining a variable?..

Answer / ss

Declaring variable means
Eg- int a;
Defining variable means we are giving some integer value to that a variable
Eg- a=100;

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Interview Questions

#include<stdio.h> int main(){ int a[]={1,2,3,5,1}; int *ptr=a+4; int y=ptr-a; printf("%d",y); }

3 Answers   Zoho,


what is the difference between structure and union?

3 Answers  


What is far pointer in c?

0 Answers  


write the output of following code .. main() { static int a[]={10,20,30,40,50}; int *ptr=a; static int arr[2][2]={1,2,3,4}; char str[]="ABCD * 4#"; char *s=str+2; int i,j; for(i=0;i<5,i++) printf("%d",*ptr++); for(i=0;i<2;i++) for(j=0;j<2;j++) printf("%d\n",*(*(n+i)+j)); printf("%c\n%c\n%c\n",*(str+2),*s++,*--s); }

1 Answers  


main(){char *str;scanf("%s",str);printf("%s",str); }The error in the above program is: a) Variable 'str' is not initialised b) Format control for a string is not %s c) Parameter to scanf is passed by value. It should be an address d) none

0 Answers  






void main() { char c; while(c=getchar()!='\n') printf("%d",c); } o/p=11 why?

8 Answers   Wipro,


How to receive strings with spaces in scanf()

7 Answers  


The statement, int(*x[]) () what does in indicate?

0 Answers  


Do you know what are bitwise shift operators in c programming?

0 Answers  


What is the use of clrscr?

0 Answers  


Write a C program to read the internal test marks of 25 students in a class and show the number of students who have scored more than 50% in the test. Make necessary assumptions.

1 Answers  


int a=1,b=2,c=3; printf("%d,%d",a,b,c); What is the output?

14 Answers   Verifone,


Categories