Study Anytime Any Where We Will Open The Knowledge For You Anish Sir 24x7 Learning solution It Is Time to join JOB
25 May 2018

Study Anytime Any Where

25 May 2018

We Will Open The Knowledge For You

25 May 2018

Anish Sir 24x7 Learning solution

25 May 2018

It Is Time to join JOB

C Programming

C++ Programming

JAVA Programming

Android Language

Android-logo.png

.Net Programming

net-logo-b55c217213ae49991589ed43d7ed58a7.png

c# Programming

photo_1389636992_quiz_image_temp.png

Asp .Net

asplogo-square.png

PHP Programming

58481791cef1014c0b5e4994.png

Search Your Topic

config
Anish Sir

Anish Sir

"I am delighted once again to pen the welcome note to the Tosh!Yas Technologies ."

 Call +91 74 88 34 7779  | Email : anishsingh@live.com

Website URL: http://toshiyas.in
Tuesday, 19 September 2017 05:07

for loop in C

for loop is a repetition control structure that allows you to efficiently write a loop that needs to execute a specific number of times.

Syntax

The syntax of a for loop in C programming language is −

for ( init; condition; increment ) {
   statement(s);
}

Here is the flow of control in a 'for' loop −

  • The init step is executed first, and only once. This step allows you to declare and initialize any loop control variables. You are not required to put a statement here, as long as a semicolon appears.

  • Next, the condition is evaluated. If it is true, the body of the loop is executed. If it is false, the body of the loop does not execute and the flow of control jumps to the next statement just after the 'for' loop.

  • After the body of the 'for' loop executes, the flow of control jumps back up to the increment statement. This statement allows you to update any loop control variables. This statement can be left blank, as long as a semicolon appears after the condition.

  • The condition is now evaluated again. If it is true, the loop executes and the process repeats itself (body of loop, then increment step, and then again condition). After the condition becomes false, the 'for' loop terminates.

Flow Diagram

for loop in C

Example

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

   int a;
	
   /* for loop execution */
   for( a = 10; a < 20; a = a + 1 ){
      printf("value of a: %d\n", a);
   }
 
   return 0;
}

When the above code is compiled and executed, it produces the following result −

value of a: 10
value of a: 11
value of a: 12
value of a: 13
value of a: 14
value of a: 15
value of a: 16
value of a: 17
value of a: 18
value of a: 19
Tuesday, 19 September 2017 04:56

while loop in C

while loop in C programming repeatedly executes a target statement as long as a given condition is true.

Syntax

The syntax of a while loop in C programming language is −

while(condition) {
   statement(s);
}

Here, statement(s) may be a single statement or a block of statements. The condition may be any expression, and true is any nonzero value. The loop iterates while the condition is true.

When the condition becomes false, the program control passes to the line immediately following the loop.

Flow Diagram

while loop in C

Here, the key point to note is that a while loop might not execute at all. When the condition is tested and the result is false, the loop body will be skipped and the first statement after the while loop will be executed.

Example

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

   /* local variable definition */
   int a = 10;

   /* while loop execution */
   while( a < 20 ) {
      printf("value of a: %d\n", a);
      a++;
   }
 
   return 0;
}

When the above code is compiled and executed, it produces the following result −

value of a: 10
value of a: 11
value of a: 12
value of a: 13
value of a: 14
value of a: 15
value of a: 16
value of a: 17
value of a: 18
value of a: 19
Tuesday, 19 September 2017 04:11

C-loop

  What is a Loop?

A loop is defined as a block of statements, which are repeatedly executed for a certain number of times.

     The loops are two types.

  • Counter-controlled repetition: This is also called the definite repetition action, because the number of iterations to be performed is defined in advance in the program itself. The steps for performing counter-controlled repetitions are as follows.

Steps in Loop

Loop variable: IT is a variable used in the loop

Initialization: It is the first step in which starting and final values are assigned to the loop variable. Each time the upload value is checked by the loop itself.

Incrimination/discrimination: It is the numerical value added or subtracted to the variable in each round of the loop. The upload value is compared with the final value and if it is found less than the final value the steps in the loop are executed.  

The above steps are implemented in numerous programs in this chapter.

  • Sentinel- controlled repetition: This is also called the indefinite repetition. One cannot estimate how many    iterations are to be performed.  In this type, loop termination happens on the basis of certain conditions using the decision-making statement.

In computer programming, a loop is a sequence of instruction s that is continually repeated until a certain condition is reached. Typically, a certain process is done, such as getting an item of data and changing it, and then some condition is checked such as whether a counter has reached a prescribed number. If it hasn't, the next instruction in the sequence is an instruction to return to the first instruction in the sequence and repeat the sequence. If the condition has been reached, the next instruction "falls through" to the next sequential instruction or branches outside the loop. A loop is a fundamental programming idea that is commonly used in writing programs.

infinite loop (endless loop)

An infinite loop (sometimes called an endless loop ) is a piece of coding that lacks a functional exit so that it repeats indefinitely. In computer programming, a loop is a sequence of instruction s that is continually repeated until a certain condition is reached. Typically, a certain process is done, such as getting an item of data and changing it, and then some condition is checked, such as whether a counter has reached a prescribed number. If the presence of the specified condition cannot be ascertained, the next instruction in the sequence tells the program to return to the first instruction and repeat the sequence, which typically goes on until the program terminates automatically after a certain duration of time, or the operating system terminates the program with an error.

Usually, an infinite loop results from a programming error - for example, where the conditions for exit are incorrectly written. 

Loop Type & Description

while loop

Repeats a statement or group of statements while a given condition is true. It tests the condition before executing the loop body.

 

for loop

Executes a sequence of statements multiple times and abbreviates the code that manages the loop variable.

 

do...while loop

 It is more like a while statement, except that it tests the condition at the end of the loop body.

 

nested loops

You can use one or more loops inside any other while, for, or do..while loop.

 

Monday, 18 September 2017 06:47

C-if else Program

Write a program to check equivalence of two numbers. Use the if statement.

#include<stdio.h>

#include<conio.h>

Void main ( )

{

        Int  m, n;

        Clrscr ( );

        Printf (“\n Enter Two Numbers  :”);

        Scanf (“%d  %d”, &m, &n);

        If (m-n==0)

        Printf (“\n Two numbers are equal. “);

        getch( );

}

OUTPUT:

Enter Two Numbers  :  5  5

Two numbers are equal.

 Write a program to check whether the candidate’s age is greater than 17 or not. If yes, display

Message ‘Eligible for Voting’.

#include<stdio.h>

#include<conio.h>

Void main ( )

{

       Int  age;

       Clrscr ( );

       Printf (“\n Enter age  :”);

       Scanf (“%d, &age);

       If (age>17)

       Printf (“\n Eligible for Voting.”);

       getch ( );

}

Write a program using curly braces in the if block. Enter only the three numbers and calculate their sum and multiplication.

#include<stdio.h>

#include<conio.h>

Void main ( )                              

{

Int a, b, c, x;

       Clrscr ( );

       Printf (“\nEnter Three Numbers:”);

       X=scanf (“%d %d %d”, &a, &b, &c);

       If (x==3)

       {

           Printf (“\n Addition  :  %d”, a,+b+c);

           Printf (“\n Multiplication  :  %d”, a*b*c);

       }

}

OUTPUT:

Enter Three Numbers:  1  2  4

Addition  :  7

Multiplication  :  8

After second time execution

Enter Three Numbers:  5  v  8

Read the values of a, b and c through the keyboard. Add them and after addition check if it is In the range of 100 and 200 or not. Print the separate message for each.

#include<stdio.h>

#include<conio.h>

Void main ( )

{

       Int  a, b, c, d;

       Clrscr (“Enter Three Numbers a b c  :”);

       Printf (“%d %d %d”, &a, &b, &c);

      Printf (“a=%d b=%d c=%d”, a, b, c);

      D=a+b+c;

      If (d<=200 && d>=100)

      Printf (“\nSum is %d which is in between 100 & 200”, d);

      else

      Printf (“\nSum is %d which is out of range”, d);

      getch ( );

}

OUTPUT:    

Enter Three Numbers a b c  :  50  52  54 

A=50  b=52  c=54

Sum is 156 which is in between 100 & 200.           

Write a program to calculate the square of those numbers only whose least significant Digit is 5.

#include<stdio.h>

#include<conio.h>

Void main ( )

{

       Int  s, d;

       Clrscr ( )

       Printf (“\n Enter  a  Number  :”);

       Scanf (“%d, &s);

       D=s %10;

       If (d==5)

       {

            S=s/10;

            Printf (“\n Square  =  % d%d”, s*s++,d*d);

       }

       Else

             Printf (“\n Invalid Number”);

}

OUTPUT:

Enter  a  Number  :  25

Square  =  625 

 

Write a program to calculate the salary of medical representative based on the sales. Sales.

Bonus And incentive to be offered to him will be based on total sales.

If the sale exceeds Rs.1, 00,000,Follow the particulars of Table 1 otherwise follow Table 2.

  1. TABLE

Basic=Rs.  3000.

Hra=20% of basic.

Da=110% of basic.

Conveyance=Rs. 500.

Incentive=10% of sales.

Bonus=Rs.  500.  
  1. TABLE

Basic=Rs.  3000.

Hra=20% of basic.

Da=110% of basic.

Conveyance=Rs. 500.

Incentive=5% of sales.

Bonus=Rs.  200.  

 

#include<stdio.h>

#include<conio.h>

Void main ( )

{

        Float bs, hra, da, cv, incentive, bonus, sale, ts; 

        Clrscr ( );

        Printf (“\n Enter Total Sales in Rs.:”);

        Scanf (“%f”, &sale);

        If (sale>100000)

        {

            Bs=3000;

            Hra=20  *  bs/100;

            Da110  *  bs/100;

            Cv=500;

            Incentive=sale*10/100;

            Bonus=500;

       }

            Else

            {

                  Bs=3000;

                  Hra=20  *  bs/100;

                  Da=110  *  bs/100;

                  Cv=500;

                  Incentive=sale*5/100;

                  Bonus=200;

            }

     Ts=bs+hra+da+cv+incentive+bonus;

     Printf (“\nTotal Sales  :  % f”, sale);

     Printf (“\nBasic salary :  % f”’, bs)

     Printf (“\nHra               :  % f”, hra);

     Printf (“\nDa                 :  % f, da);

     Printf (“\nConveyance : % f”, cv);

     Printf (“\nIncentive      : % f”, incentive)

     Printf (“\nBonus            : % f”, bonus);

     Printf (“\nGross Salary : % f”, ts);

     getch ( );

}

OUTPUT:

Enter Total Sales in Rs.  100000

Total Sales:  100000.00

Basic Salary:  3000.00

Hra:  600.00

Da:  3300.00

Conveyance:  500.00

Incentive:  10000.00

Bonus:  500.00

Gross Salary:  17900.00     

Write a program to calculate energy bill. Read the starting and ending meter readings.Charges are as follows.

No. of Units    Consumed Rates in  (Rs.)

200  -  500                           3.50

100  -  200                           2.50

Less  than  100                   1.50

#include<stdio.h>

#include<conio.h>

Void main ( )

{

       Int initial, final, consumed;

       Float total;

       Clrscr ( );

       Printf (“\n Initial & Final Readings  :”);

       Scanf (“%d  %d”,  &initial,  &final);

       Consumed  =  final – initial;

       If (consumed>=200  &&  consumed<=500)

       Total=consumed  *  3.500;

       Else if (consumed>=100  &&  consumed<=199)

       Total= consumed  *  2.500;

       Else if (consumed*1.50;

       Printf (“Total bill for %d unit is %f”, consumed, total);

       getche ( );

}

OUTPUT:

Initial  &  Final Readings  :  800  850

        

Sunday, 17 September 2017 10:44

Creating a Single Group

You can create a single group in Tally.ERP 9 and configure its details as per your requirement. You can also view, alter or delete single groups that you have created.

Creating a Group

To create a single group

1.    Go to Gateway of Tally > Accounts Info. > Groups.

2.    Click the option Create under Single Group. The Group Creation screen appears.

3.    Enter the Name of the group.

4.    Enter the Alias name, if required.

5.    In the field Under, from the List of Groups displayed, select the parent group under which the group has to be classified. For example, Indirect Expenses.

Note: Groups can be created under the group Primary, if required. To classify a group under Primary, the option Allow Advanced entries in Masters should be enabled in the Master Configuration screen.

The Group Creation screen appears as shown below:

6.    Click Yes to accept the screen.

A group can be created for advanced usage, with more options to configure, by setting the option Allow Advanced Entries in Masters in F12: Configure.

Displaying a Group

To display a group

1.    Go to Gateway of Tally > Accounts Info. > Groups.

2.    Click the option Display under Single Group.

3.    Select the name of the group required from the List of Groups displayed. The ledger display screen appears as shown below:

Note: In the display mode , group details can't be modified.

Altering a Group

The details entered in a group can be modified when required.

To alter a group

1.    Go to Gateway of Tally > Accounts Info. > Groups.

2.    Click Alter under Single Group.

3.    Select the name of the group required from the List of Groups displayed.

4.    Make the necessary changes in the Group Alteration screen.

5.    Click Yes to save the changes.

Deleting a Group

Groups can be deleted from the alteration screen. Only one group can be deleted at a time.

To delete a group

1.    Go to Gateway of Tally > Accounts Info. > Groups.

2.    Click the option Alter under Single Group.

3.    Select the name of the group required from the List of Groups displayed.

4.    Click D: Delete.

5.    Click Yes to confirm deletion.

Note: A group cannot be deleted if:

         The group has sub-groups.

         The group has ledgers classified under it.

         The group is a predefined master.

Friday, 15 September 2017 09:20

Simple Calculator using switch Statement

// Performs addition, subtraction, multiplication or division depending the input from user

# include <stdio.h>

int main() {

    char operator;
    double firstNumber,secondNumber;

    printf("Enter an operator (+, -, *,): ");
    scanf("%c", &operator);

    printf("Enter two operands: ");
    scanf("%lf %lf",&firstNumber, &secondNumber);

    switch(operator)
    {
        case '+':
            printf("%.1lf + %.1lf = %.1lf",firstNumber, secondNumber, firstNumber + secondNumber);
            break;

        case '-':
            printf("%.1lf - %.1lf = %.1lf",firstNumber, secondNumber, firstNumber - secondNumber);
            break;

        case '*':
            printf("%.1lf * %.1lf = %.1lf",firstNumber, secondNumber, firstNumber * secondNumber);
            break;

        case '/':
            printf("%.1lf / %.1lf = %.1lf",firstNumber, secondNumber, firstNumber / secondNumber);
            break;

        // operator doesn't match any case constant (+, -, *, /)
        default:
            printf("Error! operator is not correct");
    }
    
    return 0;
}

Output

Enter an operator (+, -, *,): *
Enter two operands: 1.5
4.5
1.5 * 4.5 = 6.8
Friday, 15 September 2017 09:08

Swap Numbers Using Temporary Variable

#include <stdio.h>
int main()
{
      double firstNumber, secondNumber, temporaryVariable;

      printf("Enter first number: ");
      scanf("%lf", &firstNumber);

      printf("Enter second number: ");
      scanf("%lf",&secondNumber);

      // Value of firstNumber is assigned to temporaryVariable
      temporaryVariable = firstNumber;

      // Value of secondNumber is assigned to firstNumber
      firstNumber = secondNumber;

      // Value of temporaryVariable (which contains the initial value of firstNumber) is assigned to secondNumber
      secondNumber = temporaryVariable;

      printf("\nAfter swapping, firstNumber = %.2lf\n", firstNumber);
      printf("After swapping, secondNumber = %.2lf", secondNumber);

      return 0;
}

Output

Enter first number: 1.20
Enter second number: 2.45

After swapping, firstNumber = 2.45
After swapping, secondNumber = 1.20

Program to Swap Number Without Using Temporary Variables

#include <stdio.h>
int main()
{
    double firstNumber, secondNumber;

    printf("Enter first number: ");
    scanf("%lf", &firstNumber);

    printf("Enter second number: ");
    scanf("%lf",&secondNumber);

    // Swapping process

    firstNumber = firstNumber - secondNumber;
    secondNumber = firstNumber + secondNumber;
    firstNumber = secondNumber - firstNumber;

    printf("\nAfter swapping, firstNumber = %.2lf\n", firstNumber);
    printf("After swapping, secondNumber = %.2lf", secondNumber);

    return 0;
}

Output

Enter first number: 10.25
Enter second number: -12.5

After swapping, firstNumber = -12.50
After swapping, secondNumber = 10.25
 
Friday, 15 September 2017 08:54

C- if else Program

C-Program to Check Even or Odd

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

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

    // True if the number is perfectly divisible by 2
    if(number % 2 == 0)
        printf("%d is even.", number);
    else
        printf("%d is odd.", number);

    return 0;
}


Output

Enter an integer: -7
-7 is odd.

C-Program to Check Odd or Even Using Conditional Operator

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

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

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

    return 0;
}

 

Program to display a number if user enters negative number

// If user enters positive number, that number won't be displayed

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

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

    // Test expression is true if number is less than 0
    if (number < 0)
    {
        printf("You entered %d.\n", number);
    }

    printf("The if statement is easy.");

    return 0;
}

Output 1

Enter an integer: -2
You entered -2.
The if statement is easy.

When user enters -2, the test expression (number < 0) becomes true. Hence, You entered -2 is displayed on the screen.

Output 2

Enter an integer: 5
The if statement in C programming is easy.

Friday, 15 September 2017 07:42

C-Decision Statements

Decision making structures require that the programmer specifies one or more conditions to be evaluated or tested by the program, along with a statement or statements to be executed if the condition is determined to be true, and optionally, other statements to be executed if the condition is determined to be false.

Show below is the general form of a typical decision making structure found in most of the programming languages −

Decision making statements in C

C programming language assumes any non-zero and non-null values as true, and if it is either zero or null, then it is assumed as false value.

C programming language provides the following types of decision making statements.

Statement & Description

if statement

An if statement consists of a boolean expression followed by one or more statements.


Syntax

The syntax of an 'if' statement in C programming language is −

if(boolean_expression) {
   /* statement(s) will execute if the boolean expression is true */
}

If the Boolean expression evaluates to true, then the block of code inside the 'if' statement will be executed. If the Boolean expression evaluates to false, then the first set of code after the end of the 'if' statement (after the closing curly brace) will be executed.

C programming language assumes any non-zero and non-null values as true and if it is either zero or null, then it is assumed as false value.

Flow Diagram

C if statement
#include <stdio.h>
 
int main () {

   /* local variable definition */
   int a = 10;
 
   /* check the boolean condition using if statement */
	
   if( a < 20 ) {
      /* if condition is true then print the following */
      printf("a is less than 20\n" );
   }
   
   printf("value of a is : %d\n", a);
 
   return 0;
}

When the above code is compiled and executed, it produces the following result −
a is less than 20;
value of a is : 10

if...else statement

An if statement can be followed by an optional else statement, which executes when the Boolean expression is false.

An if statement can be followed by an optional else statement, which executes when the Boolean expression is false.

Syntax

The syntax of an if...else statement in C programming language is −

if(boolean_expression) {
   /* statement(s) will execute if the boolean expression is true */
}
else {
   /* statement(s) will execute if the boolean expression is false */
}

If the Boolean expression evaluates to true, then the if block will be executed, otherwise, the else block will be executed.

C programming language assumes any non-zero and non-null values as true, and if it is either zero or null, then it is assumed as false value.

Flow Diagram

C if...else statement

Example

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

   /* local variable definition */
   int a = 100;
 
   /* check the boolean condition */
   if( a < 20 ) {
      /* if condition is true then print the following */
      printf("a is less than 20\n" );
   }
   else {
      /* if condition is false then print the following */
      printf("a is not less than 20\n" );
   }
   
   printf("value of a is : %d\n", a);
 
   return 0;
}

When the above code is compiled and executed, it produces the following result −

a is not less than 20;
value of a is : 100

If...else if...else Statement

An if statement can be followed by an optional else if...else statement, which is very useful to test various conditions using single if...else if statement.

When using if...else if..else statements, there are few points to keep in mind −

  • An if can have zero or one else's and it must come after any else if's.

  • An if can have zero to many else if's and they must come before the else.

  • Once an else if succeeds, none of the remaining else if's or else's will be tested.

Syntax

The syntax of an if...else if...else statement in C programming language is −

if(boolean_expression 1) {
   /* Executes when the boolean expression 1 is true */
}
else if( boolean_expression 2) {
   /* Executes when the boolean expression 2 is true */
}
else if( boolean_expression 3) {
   /* Executes when the boolean expression 3 is true */
}
else  {
   /* executes when the none of the above condition is true */
}

Example

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

   /* local variable definition */
   int a = 100;
 
   /* check the boolean condition */
   if( a == 10 ) {
      /* if condition is true then print the following */
      printf("Value of a is 10\n" );
   }
   else if( a == 20 ) {
      /* if else if condition is true */
      printf("Value of a is 20\n" );
   }
   else if( a == 30 ) {
      /* if else if condition is true  */
      printf("Value of a is 30\n" );
   }
   else {
      /* if none of the conditions is true */
      printf("None of the values is matching\n" );
   }
   
   printf("Exact value of a is: %d\n", a );
 
   return 0;
}

When the above code is compiled and executed, it produces the following result −
None of the values is matching
Exact value of a is: 100
 

C - nested if statements

It is always legal in C programming to nest if-else statements, which means you can use one if or else if statement inside another if or else if statement(s).

Syntax

The syntax for a nested if statement is as follows −

if( boolean_expression 1) {

   /* Executes when the boolean expression 1 is true */
   if(boolean_expression 2) {
      /* Executes when the boolean expression 2 is true */
   }
}

You can nest else if...else in the similar way as you have nested ifstatements.

Example

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

   /* local variable definition */
   int a = 100;
   int b = 200;
 
   /* check the boolean condition */
   if( a == 100 ) {
   
      /* if condition is true then check the following */
      if( b == 200 ) {
         /* if condition is true then print the following */
         printf("Value of a is 100 and b is 200\n" );
      }
   }
   
   printf("Exact value of a is : %d\n", a );
   printf("Exact value of b is : %d\n", b );
 
   return 0;
}
When the above code is compiled and executed, it produces the following result −
Value of a is 100 and b is 200
Exact value of a is : 100
Exact value of b is : 200

C - switch statement

 

switch statement allows a variable to be tested for equality against a list of values. Each value is called a case, and the variable being switched on is checked for each switch case.

Syntax

The syntax for a switch statement in C programming language is as follows −

switch(expression) {

   case constant-expression  :
      statement(s);
      break; /* optional */
	
   case constant-expression  :
      statement(s);
      break; /* optional */
  
   /* you can have any number of case statements */
   default : /* Optional */
   statement(s);
}

The following rules apply to a switch statement −

  • The expression used in a switch statement must have an integral or enumerated type, or be of a class type in which the class has a single conversion function to an integral or enumerated type.

  • You can have any number of case statements within a switch. Each case is followed by the value to be compared to and a colon.

  • The constant-expression for a case must be the same data type as the variable in the switch, and it must be a constant or a literal.

  • When the variable being switched on is equal to a case, the statements following that case will execute until a break statement is reached.

  • When a break statement is reached, the switch terminates, and the flow of control jumps to the next line following the switch statement.

  • Not every case needs to contain a break. If no break appears, the flow of control will fall through to subsequent cases until a break is reached.

  • switch statement can have an optional default case, which must appear at the end of the switch. The default case can be used for performing a task when none of the cases is true. No break is needed in the default case.

Flow Diagram

switch statement in C

Example

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

   /* local variable definition */
   char grade = 'B';

   switch(grade) {
      case 'A' :
         printf("Excellent!\n" );
         break;
      case 'B' :
      case 'C' :
         printf("Well done\n" );
         break;
      case 'D' :
         printf("You passed\n" );
         break;
      case 'F' :
         printf("Better try again\n" );
         break;
      default :
         printf("Invalid grade\n" );
   }
   
   printf("Your grade is  %c\n", grade );
 
   return 0;
}

When the above code is compiled and executed, it produces the following result −

Well done
Your grade is B
 
 

C - nested switch statements

It is possible to have a switch as a part of the statement sequence of an outer switch. Even if the case constants of the inner and outer switch contain common values, no conflicts will arise.

Syntax

The syntax for a nested switch statement is as follows −

switch(ch1) {

   case 'A': 
      printf("This A is part of outer switch" );
		
      switch(ch2) {
         case 'A':
            printf("This A is part of inner switch" );
            break;
         case 'B': /* case code */
      }
	  
      break;
   case 'B': /* case code */
}

Example

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

   /* local variable definition */
   int a = 100;
   int b = 200;
 
   switch(a) {
   
      case 100: 
         printf("This is part of outer switch\n", a );
         switch(b) {
            case 200:
               printf("This is part of inner switch\n", a );
         }
   }
   
   printf("Exact value of a is : %d\n", a );
   printf("Exact value of b is : %d\n", b );
 
   return 0;
}

When the above code is compiled and executed, it produces the following result −
This is part of outer switch
This is part of inner switch
Exact value of a is : 100
Exact value of b is : 200
 
 
 
Thursday, 14 September 2017 10:16

Pre-Defined Groups

There are twenty eight pre-defined groups in Tally.ERP 9. These groups are a part of the chart of accounts for most organizations. For example, Sales Accounts is a pre-defined group. All sales ledgers can be classified under this group.

Out of the twenty eight pre-defined groups, fifteen are primary groups and thirteen are sub-groups. The user can create any number of primary groups and sub-groups.

Primary Groups
Subgroups
Branch / Divisions
 Bank Accounts
 Capital Account
 Bank OD A/c
 Current Assets
 Cash-in-hand
 Current Liabilities
 Deposits (Asset)
 Direct Expenses
 Duties & Taxes
 Direct Incomes
 Loans & Advances (Asset)
 Fixed Assets
 Provisions
 Indirect Expenses
 Reserves & Surplus
 Indirect Incomes
 Secured Loans
Investments
Stock-in-hand
Loans (Liability)
Sundry Creditors
Misc. Expenses (ASSET)
Sundry Debtors
Purchase Accounts
Purchase Accounts
Sales Accounts
Suspense A/c

Out of the fifteen primary groups, nine primary groups appear in the balance sheets that are capital in nature and six primary groups appear under Profit & Loss account which are revenue in nature.

The sub-groups that form a part of the balance sheet are:

Pre-defined Subgroups

Under

Bank Accounts

Current Assets

Bank OD A/c

Loans (Liability)

Cash-in-hand

Current Assets

Deposits (Asset)

Current Assets

Duties & Taxes

Current Liabilities

Loans & Advances (Asset)

Current Assets

Provisions

Current Liabilities

Reserves & Surplus

Capital Account

Secured Loans

Loans (Liability)

Stock-in-hand

Current Assets

Sundry Creditors

Current Liabilities

Sundry Debtors

Current Assets

Unsecured Loans

Loans (Liability)

Note: Primary groups cannot be deleted.

Page 3 of 33