Skip to main content

Posts

Showing posts with the label numbers

Featured Post

Data Mining with Weka -Installation

Weka - Data mining Tool W eka is a tool for big data and data mining. It is used to various classification, experiments, and analysis over large data sets. Installation Guide -weka  You can download Weka from   here   and follow the normal installation procedure. After completion you will get following window, here you can begin your classification or experiment on different data sets with Weka.

Compiling sample program in C++

Write a program to print hello.    /* This is use to write comment multiplication and slash */ #include<iostream>     /* header file library for visual C++ programming*/   using namespace std;                        /*The new feature in c++ for standard name space*/  int main()                                                    /* Main function of program*/ {                                                                             /*opening curly braces for function main*/  cout <<"Hello World ! \n"   /*cout is use as called out or display output with  << "string"syntax; \n is valid  C++ syntax for newline */  return 0; /*This is the termination point of program*/ } /*closing curly braces for function main*/ OUTPUT: Hello World !

C - Program (Sequence)- Arithmetic operations

5. Write a program to read any two numbers through the keyboard and to perform arithmetic operations (ie addition, subtraction, multiplication and division) and display the result using scanf and printf function. #include <stdio.h> #include <conio.h> void main () {   int x, y, add, sub, mul, div;   printf ("Enter the value of x and y:");   scanf ("% d% d", & x, & y);   add = x + y;   sub = xy;   mul = x * y;   div = x / y;   printf ("\ nAddition =% d", add);   printf ("\ nSubtraction =% d", sub);   printf ("\ nMultiplication =% d", mul);   printf ("\ nDivision =% d", div);   getch (); }

C - Program (Sequence) - Quadratic Equation

4.Write a program to solve the quadratic equation ax ^ 2 + bx + c = 0, where x = (√-b + -b ^ 2-4ac) / 2a. #include <stdio.h> #include <conio.h> #include <math.h> void main () {   int a, b, c;   float x, y;   printf ("Enter the value of a, b & c =");   scanf ("% d% d% d", & a, & b, & c);   x = pow ((- b + b * b-4 * a * c), 0.5) / 2 * a;   y = pow ((- bb * b-4 * a * c), 0.5) / 2 * a;   printf ("value of x =% f", x);   printf ("value of y =% f", y);   getch (); }

Program (Sequence) - Area and Volume

3.Write a Program  Asking length (L), Breadth (B) and Height (h) of a room. Calculate ITS Area of Floor (af), Area of Wall (AW) and Volume (V). #include <stdio.h> #include <conio.h> void main () {   int l, b, h, af, aw, v;   printf ("Enter Length, Breadth and Height:");   scanf ("% d% d% d", & l, & b, & h);   af = l * b;   aw = 2 * h * (l + b);   v = l * b * h;   printf ("Area of ​​floor =% d \ n", af);   printf ("Area of ​​wall =% d \ n", aw);   printf ("Volume of a room =% d", v);   getch (); }

C - Program (Sequence) - Convert Temperature

2.Write a program to convert temperature in fahrenheit (F) into antigrade (c) [F = 1.8c + 32]. #include <stdio.h> #include <conio.h> void main () {   int f;   float c;   printf ("\ n Enter the temperature in Fahrenheit:");   scanf ("% d", & f);   c = (f-32) /1.8;   printf ("\ n Temperature in antigrade is:% f", c);   getch (); }

C - Program (Sequence) - Circumference of Circle

1. WAP to find area and circumfernce of a circle, where define pi as constant. #include <stdio.h> #include <conio.h> #define pi 3.14 void main () {     int r;     float a, c;     printf ("\ n Enter the radius:");     scanf ("% d", & r);     a = pi * r * r;     c = 2 * pi * r;     printf ("\ nArea of ​​a circle is =% f", a);     printf ("\ n \ nCricumference of a circle is =% f", c);     getch (); }

Format Specifier Used in 'C'

Format specifier are characters starting with% sign and followed with a character. It identifies the data type that is being processed. It is also known as "Conversion Specifier". Data Type                             Format Specifier symbol Integer                                                             % d Unsigned Integer% u Octal% o Hexadecimal% x Float% f Float (Scientific)% e Character% C String% s

Escape Sequence in 'C'

These are the character not printed when used but provide various functions.  Escape Sequences are always started with a backslash '\' Commonly used  escape sequence are: Character Escape Sequence Bell (alert) \ a Backspace \ b Horizontal tab \ t Newline \ n Carriage return \ r Quotation \ " Backslash \\ null \ 0 etc.

Keywords use in 'C'

auto char int float for continue default case const if else enum goto long short static struct switch typedef union register signed extern unsigned void while return break near far double

Data Type In 'C'

Data Types Data Type Data Sub_Type Byte Format Range Character Signed Character  1  % C -128 To 127 Unsigned Character  1  % C 0 to 255 (Numeric) Integer Short signed int  2  % D -32768 To 32767 Short Unsigned int  2  % D 0 to 65535 Long Integer Long Signed int  4  % Ld -2147483648 To 2147483647 Long Unsigned int  4  % Ld 0 to 4994967295 Float Float  4  % F 3.4E-38 to 3.4E + 38 Double Double  8  % Lf 1.7E-308 to 1.7E + 308 Long Double  10  % Lf 3.4E-4932 to 3.4E + 4932

Programming language (C)

It is structured programming language  which is used to develop operating system,  business system, text processing, database management etc.  It was developed by Dennis Ritche  in 1970 at AT and T Bell Laboratories.  Every function of C is accompanied by  their separate header file.