Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

what is the main difference between c and c++?

Answer Posted / deepesh kumar prajapati

The main difference b/w c and c++ is that " in 'c' language
we declaration any variable after main () compulsory but in
c++ any variable declaration wherever "
for ex:-

in 'c' program eg.

#include<stdio.h>
void main()
{
int a,b;
printf("enter any no.=");
scanf("%d",&a);
b=a*a;
printf("square is=%d",b);
}


In c++ eg.


#include<iostream.h>
void main()
{
int a;
cout<<"enter any no";
cin>>a;
int b=a*a;
cout<<"square is="<<b;
}

note;-
both program is same (square any no.) only difference
is first program b is declare after main() an second program
b is declared after scan value.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does and I oop mean?

1107


What is the difference between static polymorphism and dynamic polymorphism?

1030


Can main method override?

1063


Why do we use class in oops?

916


What is for loop and its syntax?

1039


Hi friends I have experience of 6 months in website design and maintanence. Now i am looking for other IT jobs.. to switch platform. please post any interview you know in chennai.

2148


What is protected in oop?

1013


What is the main purpose of inheritance law?

1149


What is encapsulation in oop?

990


What is destructor example?

991


What is encapsulation in oops?

960


Why do we need oop?

1107


Write a program to compute for numeric grades for a course. The course records are in a file that will serve as the input file. The input file is in exactly the following format: Each line contains a student's first name, then one space, then ten quiz scores all on one line. The quiz scores are in whole number and are separated by one space. Your program will take it input from this file and sends it output to a second file. The data in the output file will be exactly the same as the data in the input file except that there will be one additional number (of type double) at the end of each line. This number will be the average of the student's ten quiz scores. Use at least one function that has file streams as all or some of its arguments.

3038


What is difference between inheritance and polymorphism?

978


What is class and object in oops?

1069