difference between c and c++?
Answer Posted / radha garg
hi,
for more understanding see this program
for adding two no.
#include<stdio.h>................#include<iostream.h>
#include<conio.h> . #include<conio.h>
void main() . void main()
{ . {
int a,b,c; . int a,b;
printf("enter 2 no."); . cout<<"enter two number";
scanf("%d%d",&a,&b); . cin>>a>>b;
c=a+b; . int c=a+b;
printf("sum is=%d"c); . cout<<"sum is="<<c;
getch(); . getch
(); .
} . }
so from above we know that in c variables are declared in
above bt in case of C++ variable declaration can be
anywhere .whenever we need we declare variables
| Is This Answer Correct ? | 8 Yes | 1 No |
Post New Answer View All Answers
What is the use of pointer in c++ with example?
Explain what are single and multiple inheritances in c++?
Can comments be longer than one line?
How do you save a c++ program?
What is std :: flush?
Can union be self referenced?
What is an object in c++?
What are the benefits of operator overloading?
If you want to share several functions or variables in several files maitaining the consistency how would you share it?
Is there finally in c++?
Is linux written in c or c++?
Where must the declaration of a friend function appear?
Are c and c++ similar?
What is flag in computer?
What is the maximum combined length of command line arguments including the space between adjacent arguments?