Friday, 24 May 2019

SQL Select Statement/command:SQL Tutorial

SQL  SELECT  Statement:

The SELECT statement is used to select all data for a particular column. The data returned is stored in a result table, called the result-set

SELECT Syntax:

SELECT column1,column2,column3,....
FROM  table_name;

column1,column2.... are the field name of the table you want  to select data from the database

SELECT ALL COLUMN FROM TABLE :(you want to views all data from the table than * is used)

SELECT *
FORM table_name;

SELECT EXAMPLE:

SELECT  employee_name,age
FROM employee

Table name is employee and column name are employee_name, age

Saturday, 18 May 2019

feature of c language:c programming

Features of C:

c is a widely used language. It is a simple and easy language .C language is mainly used to developing a desktop application

  • Simple 
  • Structure programming language
  • Fast speed
  • Platform dependent
  • Case sensitive
  • Middle-level language
  • Syntax-based language
  • use of Pointer
  • Modularity 
  • Compiler-based

Simple:c language can be written into the English language so it is easy to understand the syntax and developed by programmed

Structure programming language:C is a Structure programming language because we can break the program into parts using a function so it is easy to use and understand. The function also provided code reusability

Powerful: The compilation and execution time of c language is fast because of lessor inbuild function

Platform dependent: A language is said to be a platform dependent whenever a c program is written on the same  operating system and also compile and execute  on the same operating system but not execute in a different operating system

Case-sensitive:c program is written with some predefined function, datatypes and identifier they not change.

Middle -level language:C programming language can support two-level programming instruction with the combination of low level and high language that's why it is called middle-level programming language.
  
use of pointer: pointer is a variable which holds the address of another variable. Pointer direct access to the memory address of any variable  due to this performance of an application is to improve

compile based:c language is used compiler to the compiler the program and execute the program.
A compiler is fast as compare to interpreter so compilation reduce execution time.

Tuesday, 14 May 2019

check whether a given number is even or odd using conditional operator in c and c++

C PROGRAM:

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

    printf("Enter an number: ");
    scanf("%d", &num);

    (num % 2 == 0) ? printf("%d is even.", num) : printf("%d is odd.", num);

    return 0;
}

 OUTPUT:

C++ PROGRAM:

#include <iostream>
using namespace std;
int main()
{
    int num;

    cout<<"Enter an number: ";
    cin>>num;

    (num % 2 == 0) ? cout<<num<< "is even.":cout<<num<<" is odd.";

    return 0;
}

OUTPUT:


c and c++ program to check whether a given number is odd or even

EVEN NUMBER:

 Any number divided by 2 and gives the remainder 0

ex:4(4/2 remainder 0)

ODD NUMBER: 

Any number divided by 2 and gives the remainder 1

ex:3(3/2 remainder 1)

C PROGRAM:


#include <stdio.h>

int main()
{
    int num;

    printf("Enter an number");

    scanf("%d", &num);
    
    if(num % 2 == 0)
/*number is perfectly divided by 2 then if condition is trueo therwise false go to else statement*/
        printf("%d is even.", num);
    else
        printf("%d is odd.", num);

    return 0;
}

OUT PUT:

C++ PROGRAM:

#include <iostream>
using namespace std;
int main()
{
    int num;

    cout<<"Enter an number";
    cin>>num;
    
    if(num % 2 == 0)
  /*number is perfectly divided by 2 then if condition is true
    otherwise false go to else statement*/
        cout<<num<<" is even.";
    else
        cout<<num<<" is odd.";

    return 0;
}

OUTPUT:


Monday, 13 May 2019

HELLO WORLD PROGRAM IN C,C++,JAVA,PYTHON

C:
#include<stdio.h>

int main()

{printf("Hello World");

return 0;}


C++:
using namespace std;

#include<iostream>

int main()

{cout<<"hello word";

return 0;}

java:
class Hello

{public static void main(String s[])

{System.out.println("hello world");}}

PYTHON:
print("hello world")

Sunday, 12 May 2019

C PROGRAM TO PRINT N FIBONACCI SERIES (c++,java,python)

Fibonacci Series-

A Series of numbers in which each number is the sum of two preceding number in series

Fibonacci series always start with 0 and 1

ex-0 1 1 2 3 5 8 13 (0 1 0+1=1 1+1=2 2+1=3)

c program:

#include <stdio.h> //declaration of printf and scanf define in header file

int main()
{
  int first=0,second=1,next,n;//fibonacci series always start with o and 1

  printf("Enter the number of the term of Fibonacci series:");

  scanf("%d",&n);

  printf("%d\t%d",first,second);//first print the o and 1 then calculate sum in for loop 

  for(int i=1;i<=n;i++)

  {next=first+second; //add two consecative number result 1

      first=second;//now assign 1 in first variable

      second=next;//assign 1 in second variable 

    printf("\t%d",next);//print the sum values
  }

    return 0;
}

c++ program:

#include <iostream>//declaration of cin and cout

using namespace std;

int main()
{
  int first=0,second=1,next,n;

  cout<<"Enter the number of the term of Fibonacci series:";

  cin>>n;

 cout<<first<<"\t"<<second;

  for(int i=1;i<=n;i++)

  {next=first+second;

      first=second;

      second=next;

    cout<<"\t"<<next;
  }

    return 0;
}

java program:

public class FibonacciSeries {

    public static void main(String[] args) {

    int n = 10, first = 0, second = 1;

    System.out.print("First " + n + " terms: ");

     for (int i = 1; i <= n; ++i)
      {
       System.out.print(t1 + " + ");

      int sum = t1 + t2;
      t1 = t2;
      t2 = sum;
    }
    }
}

python program:

n=int(input("Enter the number of term of fibonacci seires:"))

first=0

second=1

print(first,second,end=',')

for i in range(1,n+1):

    next=first+second

    first=second

    second=next

    print(next,end=',')


output:

Saturday, 11 May 2019

supervised,unsupervised and reinforcement in machine learning

supervised learning:

supervised learning is learning in which we teach the machine already.

In supervised learning, we fetch the collection of data set into machine. With the help of experience of data, the machine identifies a new data pattern.

In Supervised machine learning, we are given a data set and machine know what our correct answer looks like.

A supervisor or teacher is provided to the machine  and some data is already tagged with the correct answer

ex: Suppose you given a basket filled with a different kind of  vegetables now first train the machine one by one with all vegetable


* colour of the object is white and on top have some green leaves: Radish

*The shape of the object is rounded and colour brown: potato


after training the machine with data now you give a potato to the machine. Machine identify 
the name of the object.


supervised learning is classified into two categoris algorithms:

1: regression-In a regression problem we try to predict the result within a continuous result the output variable is a real value such as dollars and weight

2: classification-In a classification instead of continuous we predict the result within a discrete result

*A classification problem is when the output data is a category such as Radish and potato