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

What is a dynamic binding in c++?

698


How many namespaces are there in c++?

759


int age=35; if(age>80) {Console.WriteLine("Boy you are old");} else {Console.WrieLine("That is a good age");}

1018


What does n mean in c++?

830


Do class declarations end with a semicolon?

773


What is buffering in c++?

798


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

2012


How one would use switch in a program?

812


What is difference between class and structure in c++?

850


Explain how to initialize a const member data.

785


What are default parameters? How are they evaluated in c++ function?

882


What does it mean to declare a member function as static?

799


What is lambda in c++?

874


What is the best it certification?

817


What is the best c++ compiler?

775