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 a dynamic binding in c++?
How many namespaces are there in c++?
int age=35; if(age>80) {Console.WriteLine("Boy you are old");} else {Console.WrieLine("That is a good age");}
What does n mean in c++?
Do class declarations end with a semicolon?
What is buffering in c++?
declare an array of structure where the members of the structure are integer variable float variable integer array char variable access all elements of the structure using dot operator and this pointer operator
How one would use switch in a program?
What is difference between class and structure in c++?
Explain how to initialize a const member data.
What are default parameters? How are they evaluated in c++ function?
What does it mean to declare a member function as static?
What is lambda in c++?
What is the best it certification?
What is the best c++ compiler?