Sunday 31 December 2017

simple C or C++ program to find addition , substraction , multiplication and divide without using any function.

In this program we simply define two variable a,b for getting values. A is define first value and b is define second value.And we also define some more variables for storing the operational value.In this program we find addition, substraction, multiplication and divide. so we also  declare variables add,sub,div,multi for storing values.

SIMPLE C PROGRAM TO FIND ADD , SUBSTRACT , DIVIDE AND MULTIPLY.
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,add,sub,div,multi;
clrscr();

printf("Enter the value for A and B==");
scanf("%d%d",&a,&b);

add=a+b;
printf("Addition is:-%d".&add);

sub=a-b;
printf("Substract is:-%d".&sub);

div=a/b;
printf("Divide is:-%d".&div);

multi=a*b;
printf("Multiply is:-%d".&multi);

getch();
}


Monday 25 December 2017

program to find the size of a variable

In this program we declare 4 type of variables which is integer , float , double , char. hten we find the size of variables using size of operator.

1. Program to find the size of variables in c language.

#include<stdio.h>
#include<conio.h>

void main()
{
   int int_type;
   float float_type;
   double double_type;
   char char_type;

   clrscr();

       //size of operator is used to find the value of variables
    printf("Integer size is%d byte\n",sizeof(int_type));
    printf("Float size is%f byte\n",sizeof(float_type));
    printf("Double size is %ld byte\n",sizeof(double_type));
    printf("Integer size is%c byte\n",sizeof(char_type));

Friday 22 December 2017

Bit coins basic details

BITCOINS
https://youtu.be/21dR8L-hY60
Bitcoin is the cryptocoin currency ever invented.bitcoins is a basically a virtual currency which is developed by SATOSI NAKAMOTO in 2009.
Advantages of bitcoin is that it can be stored on a person's local hardware,this process is called cold storage and it protects the currency from being taken by others.
when the currency is stored on the internet then our currency is in high risk of it being stolen.


HOW BITCOINS ARE WORK

Bitcoins are completely virtual coins which is designed to be self-contained for their value,because they no need for banks to move and store the money.Once you own bitcoins, they behave like

Basic concept of c++

The basic purpose of C++ programming was to add object orientation to the C programming language,
 which is in itself one of the most powerful programming languages.
The core of the pure object-oriented programming is to create an object, in code, that has certain properties and methods.
While designing C++ modules, we try to see whole world in the form of objects.
 For example a bike is an object which has certain properties such as color, number of tyers, and the like.
It also has certain methods such as accelerate, brake, and so on.

There are some concepts of object-oriented programming -

Object
This is the basic unit of object oriented programming. That is both data and function that operate on data are bundled as a unit called as object.

Class
When you define a class, you define a blueprint for an object. This doesn't actually define any data, but it does define what the class name means,
 that is, what an object of the class will consist of and what operations can be performed on such an object.

Abstraction
Data abstraction refers to, providing only essential information to the outside world and hiding their background details,
For an example, a database system hides certain details  how data is stored and created and maintained.

Encapsulation
Encapsulation is placing the data and the functions that work on that data in the same place. While working with procedural languages,
it is not always clear which functions work on which variables but object-oriented programming provides you framework to place the data
 and the relevant functions together in the same object.

Inheritance
One of the most useful aspects of object-oriented programming is code reusability. As the name suggests Inheritance is the process of forming
a new class from an existing class that is from the existing class called as base class, new class is formed called as derived class.
This is a very important concept of object-oriented programming since this feature helps to reduce the code size.

Polymorphism
The ability to use an operator or function in different ways in other words giving different meaning or functions
 to the operators or functions is called polymorphism. Poly refers to many. That is a single function or an operator
functioning in many ways different upon the usage is called polymorphism.

Overloading
The concept of overloading is also a branch of polymorphism. When the exiting operator or function is made to operate
 on new data type, it is said to be overloaded.

Wednesday 20 December 2017

Basic concepts of c lanuage


C is a general-purpose high level language that was originally developed by Dennis Ritchi for the Unix operating system.
The Unix operating system and virtually all Unix applications are written in the C language.
 C has now become a widely used professional language for various reasons.

1)Easy to learn.

2)Structured language.

3)It produces efficient programs.

4)It can handle low-level activities.

5)It can be compiled on a variety of computers.


About C's facts

1)C was invented to write an operating system called UNIX.

2)C is a successor of B language which was introduced around 1970.

3)The language was formalized in 1988 by the American National Standard Institue (ANSI).

4)By 1973 UNIX OS almost totally written in C.

program for print ASCII values in c or c++

1. C PROGRAM TO PRINT ASCII VALUES.

#include<stdio.h>
#include<conio.h>

void main()
{
char c;

clrscr();

printf("Enter a character:-");

//reads characters from user
scanf("%c",&c);

printf("ASCII value of character= %d", c);

//%d is displays the integer value of a character

getch();
}

Tuesday 19 December 2017

Program to multiply two numbers in c or c++

1. C PROGRAM TO MULTIPLY TWO FLOATING NUMBERS.

#include<stdio.h>
#include<conio.h>

void main()
{
float firstnumber , secondnumber , resultofnumbers;
clrscr();

printf("Enter two numbers:-");

//store two float numbers in firstnumber and secondnumber variable
scanf("%f  %f", &firstnumber  , &secondnumber);

//perform the multiplication for result and stroed the result in resultofnumbers variable

resultofnumbers = firstnumber * secondnumber ;

//display result in resultofnumbers variable

printf("%f", resultofnumbers);

getch();
}


2. C++ PROGRAM TO MULTIPLY TWO FLOATING NUMBERS.


Add two integer number in c or c++

In this program, user is asked to enter two integers. Then, the sum of those two integers is stored in a variable and displayed on the screen.

1.ADD TWO INTEGER NUMBER IN C.

#include<stdio.h>
#include<conio.h>

void main()
{

int firstnumber ,  secondnumber ,  sumofnumbers;

clrscr();

printf("Enter two number:-");

//two integer number entered by user is stored using scanf()
 scanf("%d%d",&firstnumber,&secondnumber);

//sum of two number is stored in variable sumofnumbers
sumofnumbers=firstnumber+secondnumber;

//display sumofnumbers
printf("%d+%d=%d",firstnumber , secondnumber , sumofnumbers);

getch();

}

Monday 18 December 2017

Program in c or c++ to print number entered by user

1.PROGRAM IN C FOR PRINT ENTERED NUMBER BY USER.

#include<stdio.h>
#include<conio.h>
void main()
{
int num;
clrscr();

printf("Enter the number="); //printf() displays the formatted output

scanf("%d",&num); //scanf() reads the formatted inputs and stored them

printf("you entered:-%d",num); //display the output
getch();
}

Hello world program in C and C++

1.HELLO WORLD PROGRAM IN C LANGUAGE.

#include<stdio.h>
#include<conio.h>
void main()
{
printf("Hello world"); //printf() is used for displaying string inside this function
getch();
}