Saturday, October 5, 2019



 International Institute for Special Education (IISE) के द्वारा  संस्कृतिक और खेल कुद प्रतियोगिता का आयोजन

 लखनऊ .. कल्याणपुर International Institute for Special Education (IISE) कालेज के द्वारा विगति वर्षो की भाँति इस वर्ष भी कालेज के द्वारा दिंनाक 11.10.2019 से 13.10.2019 तक  SKOOL _X_PLORE 2K19  का आयोजन किया गया है जिसमें विभिन्न प्रकार के सांस्कृतिक कार्यक्रम खेल कूद और कामेडी का आयोजन किया गया है जिसमे लखनऊ और आस पास जिलों के कई बडे बडे कालेजों के छात्र -छात्राए अपना हुनर दिखाएंगे
13 तारीख को लास्ट राउंड मे विजेता होने वाले छात्र -छात्राओं को पुरस्कार वितरण किया जाएगा

 स्पोट इवेंट ...

 क्रिकेट,फुटबॉल,बालीबाल, चेस,कैरमबोर्ड,कबड्डी,टंग ऑफ वार
 संस्कृतिक कार्यक्रम

 डांस,सिगिंग, कविता,कामेडी, फोटोग्राफी , 

 14/10/19 शाम 06:00

 The Great Indian Laughter Challenge Abhay Kumar Sharma

 अत: आप सभी से निवेदन है कि iise campus kalyanpur Lucknow  में आके इस प्रतिभाग को सफल बनाने!

Tuesday, October 1, 2019

Write a program to calculate factorial, Write a program to calculate factorial of a number, factorial program.

                                          1. Factorial

Write a program to calculate factorial of a number. Number being entered by user.



#include<stdio.h>
#include<conio.h>
int fact(int);
void main()
{
   int n,result;
   clrscr();
   printf("Enter the number");
   scanf("%d",&n);
   result=fact(n);
   printf("\n the factorial of %d is %d",n,result);
   getch();
}
int fact(int x)
{
       if(x==1)
       {
             return (x);
        }
         else
         {
                return(x* fact(x-1));
          }
 }
Output of the program
Enter the number 5
The factorial of 5 is 120

Array in C and C++, C++ Array, Types of Array in C++, Pointer to an array,Passing Array To Function.

Arrays C++

Array is a fixed size collection of similar data type items. Arrays are used to store and access group of data of same data type.
Arrays can of any data type. Arrays must have constant size. Continuous memory locations are used to store array.
It is an aggregate data type that lets you access multiple variables through a single name by use of an index. Array index always starts with 0.



Example for Arrays:-

int a[5]; // integer array
char a[5]; // character(string) array
In the above example, we declare an array named a. When used in an array definition, the subscript operator ([]) is used to tell the compiler how many variables to allocate. In this case, we’re allocating 5 integers/character. Each of these variables in an array is called an element.



Types of Arrays:-


# One Dimensional Array
# Two Dimensional Array
# Multi Dimensional Array 


1. One Dimensional Array

Array declaration
int age [5];

Array initialization
int age[5]={0, 1, 2, 3, 4, 5};

Accessing array
age[0]; /0_is_accessed/
age[1]; /1_is_accessed/
age[2]; /2_is_accessed/



2. Two Dimensional Array

Two dimensional array is combination of rows n columns.
Array declaration
int arr[2][2];

Array initialization
int arr[2][2] = {{1,2}, {3,4}};

Accessing array
arr [0][0] = 1;
arr [0][1] = 2;
arr [1][0] = 3;
arr [1][1] = 4;


3. Multi Dimensional Array

C++ programming language allows programmer to create arrays of arrays known as multidimensional arrays.
For example:
float a[2][4][3];



Pointer to an array

Please go through pointers chapter first to understand this
An array name is a constant pointer to the first element of the array. Therefore, in the declaration:
double balance[50];

balance is a pointer to &balance[0], which is the address of the first element of the array balance. Thus, the following program fragment assigns p the address of the first element of balance:
double *p;
double balance[10];
p = balance;

It is legal to use array names as constant pointers, and vice versa. Therefore, *(balance + 4) is a legitimate way of accessing the data at balance[4].




Passing Array To Function

We can pass entire Arrays to functions as an argument.
For eg.
#include
void display(int a)
{
  int i;
  for(i=0;i < 4;i++){
    cout << a[i];
  }
}
int main(){
  int c[]={1,2,3,4};
  display(c);
  //Passing array to display.
  return 0;
}



Return array from functions

C++ does not allow to return an entire array as an argument to a function. However, You can return a pointer to an array by specifying the array's name without an index.
If you want to return a single-dimension array from a function, you would have to declare a function returning a pointer as in the following example:

int * myFunction()
{
int c[]={1,2,3}
.
.
.
return c
}

Structure Of C++ Program, C++ Programming structure, Programming structure.



Structure Of Program C++


/* This Program prints Hello World on screen */

#include <iostream.h>
using namespace std;
int main ()
{
cout << "Hello World!";
return 0;
}


1 . /* This program ... */
The symbols/* and*/ used for comment. This Comments are ignored by the compiler, and are used to provide useful information about program to humans who use it.


2. #include <iostream.h>
This is a preprocessor command which tells compiler to include iostream.h file.



3. using namespace std; 
All the elements of the standard C++ library are declared within what is called a namespace, the namespace with the name std. So in order to access its functionality we declare with this expression that we will be using these entities. This line is very frequent in C++ programs that use the standard library.


4. main()
C++ programs consist of one or more functions. There must be one and only one function called main. The brackets following the word main indicate that it is a function and not a variable.



5. { }
braces surround the body of the function, which may have one or more instructions/statements.

6.    Cout<<
it is a library function that is used to print data on the user screen.



7. ''Hello World'' is a string that will be displayed on user screen


8.  a semicolon ends a statement.


9. return 0; return the value zero to the Operating system.



if else ladder statement in c++, If Else Statement in C++,Ladder in c++.

                                      

                                        If  Else Ladder Statement in C++

            
                             Syntax:-
                             

                               if()
                              {
                                statement 1;
                              }
                              else if()
                              {
                                statement 2;
                               }
                              else if()
                              {
                                statement 3;
                              }
                              else
                              {
                                statement 4;
                              }


1. It is a part of conditional statement that executes on;y one condition at a time.
2. If all conditions are false then else part executes.
3. It executes that condition that becomes first true from the top.
4. In the case of if in the place of condition always zero and non-zero value is checked in which zero means condition false and non-zero means condition true

Example:-

#include<iostream.h>
int main()
{
//Assigning value to the variable
int x=10;

if(x>5)//checking the condition
{
cout<<"x is greater than 5";
}
else if(x<8)//checking the condition
{
cout<<"x is less than 8";
}
else if(x==10)//checking the condition
{
cout<<"x is equal to 10";
}
else
{
cout<<"No one condition is true";
}
}

                                  ### OUTPUT###
                         x is greater than 5

As we can see from the above program there are three conditions in which first and third condition are true but the it executes only one condition that becomes first true from the above so the output is x is greater than 5.