- Get link
- X
- Other Apps
Learn first C language and then learn C++ language
Every 1st year student have a question is what we have to learn in programming language first. “C” language or “C++” language ?? so the answer is first you have to learn “c” language this is basic of programming language so you learn the machine language and practice the basic program. You have not to learn the program you practice the program and almost you want to practice 150 – 200 question between learning programming so you get perfect in thinking about how you approach the programming & you also keep in mind “practice makes man perfect” .
After many practices you can go for C++ language and this is the advanced version of “C language” and this language was come in 1983 and this language was create by “Bjarne Stroustrup” he was the founder of C++ language.
After c++ language you can read for learn more language and language are like JAVA ,PYTHAN,C#.NET etc many more languages .if you like this simple and small coding blog please view our other blog which are small in word but very useful.
Note-
There is KEYWORD difference in c and c++ language and mostly coding in same but in c++ there is more to learn .
Basic programs of C language --
#include<stdio.h>
int main()
{
int a,b,c;
float d ;
printf("Enter the value of a =");
scanf("%d",&a );
printf("Enter the value of b =");
scanf("%d",&b );
printf( "Addition of Two Number\n" );
c=a+b;
printf("Addition = %d\n\n ",c);
printf( "Subtraction of Two Number\n" );
c=a-b;
printf("Subtraction = %d\n\n ",c);
printf( "multiplication of Two Number\n" );
c=a*b;
printf("multiplication = %d\n\n ",c);
printf( "division of Two Number\n" );
d=a/b;
printf("division = %f\n\n ",d);
// Here we use 'f' as float - for rational number
return 0;
}
output -
Enter the value of a =90
Enter the value of b =90
Addition of Two Number
180
subtraction of Two Number
0
Multiplication of Two Number
8100
Division of Two Number
1
Basic program of C++ language -
#include<iostream>
using namespace std;
int main()
{
int a, b, c;
cout << "Enter the value of a =";
cin >> a;
cout << "Enter the value of b =";
cin >> b;
cout << "Addition of Two Number"<< "\n";
c = a + b;
cout << c << "\n";
//Subtraction two number
cout << "subtraction of Two Number"<< "\n";
c = a - b;
cout << c << "\n";
//Multiplication two number
cout << "Multiplication of Two Number" << "\n";
c = a * b;
cout << c << "\n";
//Division of two number
cout << "Division of Two Number" << "\n";
c = a / b;
cout << c << "\n";
return 0;
}
int main()
{
int a, b, c;
cout << "Enter the value of a =";
cin >> a;
cout << "Enter the value of b =";
cin >> b;
cout << "Addition of Two Number"<< "\n";
c = a + b;
cout << c << "\n";
//Subtraction two number
cout << "subtraction of Two Number"<< "\n";
c = a - b;
cout << c << "\n";
//Multiplication two number
cout << "Multiplication of Two Number" << "\n";
c = a * b;
cout << c << "\n";
//Division of two number
cout << "Division of Two Number" << "\n";
c = a / b;
cout << c << "\n";
return 0;
}
output -
Enter the value of a =90
Enter the value of b =90
Addition of Two Number
180
subtraction of Two Number
0
Multiplication of Two Number
8100
Division of Two Number
1
Comments
Post a Comment