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
Write a corrected statement in c++ so that the statement will work properly. if (4 < x < 11) y=2*x;
Is c# written in c++?
Do inline functions improve performance?
Why is c++ not purely object oriented?
Why are pointers used?
Write is a binary search tree? Write an algo and tell complexity?
What are pointers, when declared, intialized to a) NULL b) Newly allocated memory c) Nothing. Its random
How static variables and local variablesare similar and dissimilar?
What is the default width for ouputting a long integer using the insertion operator?
Which bit wise operator is suitable for putting on a particular bit in a number?
Why is swift so fast?
What is the operator in c++?
What do you mean by a template?
What is the use of dot in c++?
Write down the equivalent pointer expression for referring the same element a[i][j][k][l]?