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

Which bitwise operator is used to check whether a particular bit is on or off?

682


write a porgram in c++ that reads an integer and print the biggest digit in the number

1866


What is dev c++ used for?

689


What is stoi in c++?

804


What is new in c++?

670






Does improper inheritance have a potential to wreck a project?

742


What is an object in c++?

695


what is C++ objects?

772


Differences between private, protected and public and give examples.

662


Explain overriding.

681


Explain the difference between static and dynamic binding of functions?

652


How does class accomplish data hiding in c++?

785


What are shallow and deep copies?

726


What are the uses of pointers?

665


Why would you use pointers in c++?

716