Wednesday, June 16, 2021

Object Paradigm Oriented Programming in C++ / object oriented programming / History of C++/ paradiagram in c++/C devolop, Operating System, Unix operating system, Assembly language, popular in world, Programming language.

 Object Paradigm Oriented Programming 

  • Two programmers, Brian Kernighan and Dennis Ritchie developed a new language called C, in 1972. 
  • C language was designed for writing operating systems. 
  • UNIX operating system was developed using C and assembly language.
  •  C language was very simple and flexible. 
  • Very soon it was used for many different types of programs and it quickly became one of the most popular programming languages in the world. 
  • C has one major problem that is; it is procedure-oriented language. 
  • This means that in designing a typical C program, the programmer would start by describing the data and then write procedures to manipulate that data. 
  • In C more emphasis is given on doing things rather than data.

Sunday, June 6, 2021

Conditional control statements/selection control statements/decision control statement.

 Decion control statements:

When dealing with section statements,there are generally three versions:

1 one-way

2 two way

3 three way

One way decision statements do a perticular thing or they don't .

two way decision statement can do one think /do another.

Multi-way decision statements can do of many different thinks depending on the value of an expression.

1] if  [one way decision ]

One way decisions are handled with an if statements that either do some particular things. 

The decision is based on a text expression that evaluates to either true or false. 

If the test expression evaluates of true, 

The corresponding statements is executed; 

If the test expression evaluates to false,

Control goes to the next executable statement. 

Following syntax of one way decision statement:

Syntax=

        If [Expression ]

        {

            Statements;

        }


if else


If-else-if Ladder in c-programming


 if-else-if Ladder:

 A common programming construct is the if-else-if ladder, sometimes called the it- else-if staircase because of its appearance.

Syntax:

           if(Expression-1) 

                  statement-1; 

           else if(Expression-2) 

                         statement-2; 

                    else if(Expression-3) 

                                statement-3; 

                                 - - - - - - - 

                                 - - - - - - -

                                else if(Expression-N)

                                           statement-N; 

                                   else 

                                           statement-F;

The expressions are evaluated from the top downward .

As soon as a true expression is found, the statement associated with it is executed and the rest of the ladder is bypassed .

If none of expression are true, the final else is executed. 


Sunday, October 4, 2020

Computer graphics with advantages in c-programming

 Computer Graphics :


▪️ Computer graphics are graphics created using computer and, more generally, the repetation and manipulation of image data by computer with help from specialized software and hardware.

▪️ Term computer ghraphics include everything on computers that is not text or sound.

▪️ Torbo C has a good collection of graphics librarities. If you know the basics of C, you can easily learn graphics programming.

Modes Of Computer Graphics :

▪️ Many video adapters support several different modes of resolution, all of which are divided into two categories.

• Caracter mode 

• Graphics mode

▪️ Of the two modes, graphics mode is the more sophisticated. Programs than run in graphics mode can display an unlimited varity of shape and founts.

▪️ Whears program running in character mode are severaly limited.

▪️ Programs that runs entirely in graphics mode are called graphics-based programs.

▪️ In character mode, the display screen in treatedas an array of blocks, each of which can hold one ASCII character.

▪️ In graphics mode, the display screen is treated as an array of pixels characters and other shapes are formed by turning on on combinations of fixels.

Advantages of computer graphics :

▪️ The development of computer graphics has made computers easier to interact with, and better for understanding and interpreting many types of data.

▪️ Developments in computer graphics have had a profound impacton many types of media and have revolutionized animation,movies and the video game industry.

▪️ computer graphic design can offer you a variety of career options.


Friday, October 2, 2020

Explain structure and union


Structure :

▪️ Structure is the collection of non homogeneous data elements.

▪️ Each data element has it's own storage area in memory.

▪️ The size allocated to store the structure, in the memory, is the sum of memory required to store all the elements.

▪️ All elements can be access any time.

▪️ "struct" keyword is used to defin and declared structure format and it's variable.

▪️ Variable declare within struct is called as structure member and name of the structure is called as structure tag.

▪️ Structure member can not be initialized within the structure defination.

▪️ All elements of structure variable can be initialized at the time of declaration.

▪️ Defination of structure

struct  student
{
     char name[10];
     int roll_no;
     float per;
};

Union :

▪️ Union is also the collection of non homogeneous data elements.

▪️ All the data elements share the same memory location.

▪️ Size required to store union is the same as tge size required to store the element of the largest variable type in union.

▪️ One element can be accessed at a time.

▪️ "union" key word is used to defineand declared union format and it's variable.

▪️ Variable declated within union is known as union member and namecof union is called as union tag .

▪️ Union member can not be initialized within the union defination .

▪️ only first element of union variable can be initialized at the time of declaration.

▪️ Definition of union

union student
{
    char name[10];
     int roll_no;
     float per;
};


Tuesday, September 29, 2020

Pointer of string with example

 

Pointer of string:

▫️ As we can have the pointer togeneral array, we can also have a pointer to string .

When we storethe string address of the string to the pointer variable, this pointer variable is called as pointer to string.

char      string variable [size],*ptr;

 Ex         ptr = &string1[0];


Example :

#include<stdio.h>

#include<conio.h>

# include<string.h>

main( )

{

    char str[80],*ptr;

     int k,length,count=0, M=0, R=0, U=0, G=0, N=0, A=0, Y=0, N=0, I=0;

    printf("Enter a line of text\n");

    gets(str);

length=strlen(str);

    ptr=str;

for(k=0;k<length;k++)

{

     if( (*ptr=='m') || (*ptr=='M') )

     {      M++;    count++;}

    if( (*ptr=='r') || (*ptr=='R') )

    {      R++;     count++;}

    if( (*ptr=='u') || (*ptr=='U') )

    {      U++;      count++;}

    if( (*ptr=='g') || (*ptr=='G') )

    {      G++;       count++;}

     if( (*ptr=='a') || (*ptr=='A') )

    {      A++;       count++;}

    if( (*ptr=='n') || (*ptr=='N') )

    {      N++;       count++;}

    if( (*ptr=='a') || (*ptr=='A') )

    {       A++;      count++;}

    if( (*ptr=='y') || (*ptr=='Y') )

    {       Y++;      count++;}

    if( (*ptr=='a') || (*ptr=='A') )

    {      A++;      count++;}

     if( (*ptr=='n') || (*ptr=='N') )

     {       N++;     count++;}

     if( (*ptr=='i') || (*ptr=='I') )

     {       I++;     count++;}   

       Ptr++;

}

  printf("Name of character present in screen = %d \n",count);

printf( "M = %d \n",Y);

printf( "R = %d \n",R);

printf( "U = %d \n",U);

printf( "G = %d \n",G);

printf( "A = %d \n", A);

printf( "N = %d \n",N);

printf( "A = %d \n",A);

printf( "Y = %d \n",Y);

printf( "A = %d \n",A);

printf( "N = %d \n",N);

printf( "] = %d \n",]);

}


Output:

Enter the line text 

Mrunali is best in all student

Name of character present in screen = 12

M = 1

R = 1

U = 2

G = 0

A = 2

N = 3

Y = 0

I = 3




Object Paradigm Oriented Programming in C++ / object oriented programming / History of C++/ paradiagram in c++/C devolop, Operating System, Unix operating system, Assembly language, popular in world, Programming language.

  Object Paradigm Oriented Programming  Two programmers, Brian Kernighan and Dennis Ritchie developed a new language called C, in 1972.  C l...