Write a C program to display transpose of matrix using user defined function.


#include<stdio.h>
#include<conio.h>
void transpose(int a[3][3],int n);
void main()
{
int a[3][3],trans[3][3];
int i,j,n;
clrscr();
printf("\n enter the limit");
scanf("\n %d",&n);
printf("\n enter the array element-");
for(i=0;i<n;i++)
 {
 for(j=0;j<n;j++)
  {
  scanf("\n %d", &a[i][j]);
  }
 }
  transpose(a,n);
getch();
}
void transpose(int a1[3][3],int n1)
{
   int trans[3][3];
   int i,j;
for(i=0;i<n1;i++)
 {
 for(j=0;j<n1;j++)
  {
  trans[i][j]=a1[j][i];
  }
 }
printf("\n the transpose of matrix is\n-");
for(i=0;i<n1;i++)
 {
 for(j=0;j<n1;j++)
  {
  printf("\t %d",trans[i][j]);
  }
 printf("\n");
}
getch();
}

/* Output
 enter the limit-3
 enter the array element-
        1 2 3
        4 5 6
        7 8 9

 the transpose of matrix is
         1       4       7
         2       5       8
         3       6       9 */

C program to calculate sum of all even numbers in an array.


#include<stdio.h> 
#include<conio.h>
void main()
{
int a[5];
int i,sum=0;
clrscr();
printf("\n enter the array element-");
for(i=0;i<5;i++)
 {
 scanf("\n %d",&a[i]);
 }
for(i=0;i<5;i++)
 {
   if(a[i]%2==0)
            {
               sum=sum+a[i];
               }
 }
printf("\n the sum of even number is %d",sum);
getch();
}
/* output

 enter the array element-
22
55
34
79
11

 the sum of even number is 56 */

Write a Socket program in java for simple stand-alone chatting application.

Client.java

   import java.net.*;
   import java.io.*;
class Client
{
    public static void main(String[] args) throws Exception
    {
        Socket s=new Socket("localhost",500);
        System.out.println("Client send request to server!");
        DataOutputStream dos=new DataOutputStream(s.getOutputStream());
        DataInputStream dis=new DataInputStream(s.getInputStream());
        InputStreamReader ir=new InputStreamReader(System.in);
        BufferedReader br=new BufferedReader(ir);
        while(true)
        {
            System.out.println("Client:");
            dos.writeUTF(br.readLine()); //send response to server.            System.out.println("Server:");
            System.out.println(dis.readUTF()); //Received from server.        }
    }
}

Server.java
 
       import java.net.*;
        import java.io.*;
class Server
{
    public static void main(String[] args) throws Exception
    {
        ServerSocket ss=new ServerSocket(500);
        System.out.println("Wait for client!");
        Socket s=ss.accept();
        System.out.println("Server accpted request");
        DataOutputStream dos=new DataOutputStream(s.getOutputStream());
        DataInputStream dis=new DataInputStream(s.getInputStream());
        53        InputStreamReader ir=new InputStreamReader(System.in);
        BufferedReader br=new BufferedReader(ir);
        while(true)
        {
            System.out.println("Client:");
            System.out.println(dis.readUTF()); //Receives info from client.            System.out.println("Server:");
            dos.writeUTF(br.readLine()); //sends response to client        }
    }
}

C++ Program Write a ‘C’ Program to append the containt of one file at the end of another file.





#include<stdio.h>
#include<conio.h>
void main()
{
FILE *fp;
char ch;
clrscr();
fp=fopen("b.txt","a");
if(fp==NULL)
{
printf("\n Unable to open");
}
 while((ch=getchar())!=EOF)
{
fputc(ch,fp);
}
fclose(fp);
getch();
}
/* output
india is my country
all indians are may brothers and sisters.^Z^Z*/

Tally Question No. 4:




Question No. 4: Write the steps to
  1. Delete a ledger
  2. Modify a voucher
  3. Create an user
  4. Delete a voucher
  5. Alter company information
Answer:

Delete a ledger :
We can delete the legers by using the following steps:
  1. Click on Accounts Info from Gateway of Tally
  2. Click on Ledgers
  3. Click in Single Ledger
  4. Click on Alter , it displays a list of ledgers available
  5. Double click on the ledger which we want to delete.
  6. Then it displays ledger Alteration Screen
  7. Press Alt key + D from the key board
  8. It displays delete Yes or No dialog box.
  9. Click on Yes.

Modify a voucher : We can modify a voucher already entered. For this the following steps to be done
  1. Click on Display from Gateway of Tally
  2. Click on Accounts Books
  3. Click on Ledger
  4. Double Click on the Ledger which we want to modify
  5. From the list of vouchers Double click on the voucher which we want to modify
  6. Select the Voucher type command from the command bar or Press the Short cut key to change the voucher type.
  7. Make the necessary changes
  8. Press Ctrl + A from the keyboard to save it
Create an user : When we are maintaining security layers we should create users and allot the rights to them
The steps to create users are:
  1. Press Alt + F3 to open Company info menu
  2. Click on Security Control
  3. Click on users and passwords
  4. A dialog box will be opened ,
  5. Type the user names in Name of user area
  6. Type the Password in Password area
  7. Select the security level.
  8. In this way we can create no of users.
  9. Press enter key to save the transaction
  10. Click on Yes
Delete a voucher : To delete a voucher the following steps to be done
  1. Click on Display from gateway of Tally Menu.
  2. Click on Account Books
  3. Click on ledger
  4. Select the ledger
  5. Select the voucher which we want to delete
  6. Press Alt+ D from the keyboard
  7. Click on Yes to delete the voucher

Alter company information : If any requirement to alter/modify the information of already created company, the following steps to be done
1.     Press Alt + F3 to open Company info menu
2.     Click on Alter, it will displays available companies list
3.     Select the company which we want to modify the information
4.     Then it opens company alteration screen
5.     Make necessary changes.
6.     Press Ctrl + A , to save the contents
7.     Press Esc key from the keyboard to come out to the menu area.