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


Please Help Members By Posting Answers For Below Questions

What is a class template?

593


Is java a c++?

568


What is the full form of dos?

570


How c functions prevents rework and therefore saves the programers time as wel as length of the code ?

625


Am pass the 10000 records to target in target I will take commit interval 15000 when I was stop the work flow what will happened

1081






What are c++ templates used for?

621


Why ctype h is used in c++?

527


Is dev c++ a good compiler?

529


When does a name clash occur in c++?

717


What is the best c++ compiler?

596


Why c++ is better than c language?

567


How can we access protected and private members of a class?

591


Define a constructor?

594


What is capacity in vector in c++?

551


What is vectorial capacity?

653