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
Explain this pointer?
What c++ is used for?
Write a code/algo to find the frequency of each element in an array?
Who discovered c++?
Show the declaration for a static function pointer.
What is abstraction with real time example?
What is virtual base class uses?
Is c++ primer good for beginners?
Write a Program for find and replace a character in a string.
Define a conversion constructor?
How are the features of c++ different from c?
What's the hardest coding language?
How can an improvement in the quality of software be done by try/catch/throw?
List the advantages of inheritance.
Why we use #include iostream in c++?