Tuesday 2 January 2018

program in c or c++ to print message without using any semicolon in program.

In this program we are simply use a if conditional statement to print  message without using any semicolon.Now let see the program :-


PROGRAM IN C TO PRINT MESSAGE WITHOUT USING SEMICOLON.

#include<stdio.h>

void main()
{
if(printf("hello"))
{}
}
 

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();
}