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 best book for c++ beginners?
What is the use of turbo c++?
What do you mean by early binding?
Can static member variables be private?
What is a base class?
What does flush do c++?
Describe the process of creation and destruction of a derived class object?
Suppose that data is an array of 1000 integers. Write a single function call that will sort the 100 elements data [222] through data [321].
What is c++ namespace?
Why pointer is used in c++?
What is the use of main function in c++?
What are pointer-to-members in C++? Give their syntax.
Will the following program execute?
What flag means?
Differentiate between a copy constructor and an overloaded assignment operator.