Monday, October 5, 2015

Write a program to find the sum of first ‘n’ odd natural numbers, where ‘n’ is entered by the user.

Solution:-
     #include<conio.h>
     #include<stdio.h>
     void main ( )
     {
              int i,n,sum,odd;
              clrscr( );
              scanf("%d",&n);
              sum = 0;
              odd = 1;
              for(i=1;i<=n;i++)
              {
                      sum=sum+odd;
                      odd=odd+2;
              }
              printf("%d\t",sum);
              getch( );
     }
 

Write a program to display the series: 1, 8, 27, up to 10th term using for loop.

Solution:-
    #include<conio.h>
    #include<stdio.h>
    void main ( )
    {
            clrscr( ) ;
            int term,cube;
            printf(" Display the series 1, 8, 27, 64,  ........ up to 10th term : \n");
            for(term=1;term<=10;term++)
            {
                   cube=term*term*term;
                   printf("%d\t",cube);
            }
            getch( );
    }

Write a program to display the multiplication table of 1 to 10 using do while loop.

Solution:-
   #include<stdio.h>
   #include<conio.h>
   void main( )
   {
            int row,col,table;
            clrscr( );
            printf("Multiplication table 1 to 10 \n");
            row=1;
            do
            {
                   col=1;
                   do
                   {
                            table=row*col;
                            printf("%d\t",table);
                            col ++ ;
                   }
                   while(col<=10);
                   printf("\n");
                   row ++ ;
            }
            while(row<=10);
            getch( );
   }

Write a program to read two 3 × 3 matrices and calculate and display the sum of those two matrices.

Solution:-
#include<stdio.h>
#include<conio.h>
void main( )
{
       clrscr( );
       int i,j,total;
       int matrix[3][3],matrix1[3][3],sum[3][3];
       printf("Enter the 3*3 matrix \n");
       for(i=0;i<3;i++)
            {
                     for(j=0;j<3;j++)
                    {
                            scanf("%d",&matrix[i][j]);
                     }
             }
        printf("Enter the 3*3 matrix1 \n");
        for(i=0;i<3;i++)
        {
                 for(j=0;j<3;j++)
                {
                       scanf("%d",&matrix1[i][j]);
                 }
        }
        for(i=0;i<3;i++)
       {
                 for(j=0;j<3;j++)
                {
                        sum[i][j]=matrix[i][j]+matrix1[i][j];
                 }
        }
        for(i=0;i<3;i++)
        {
                  for(j=0;j<3;j++)
                 {
    
                        printf("%d\t ",sum[i][j]);
                 }
                 printf("\n");
        }
        getch( );
}
 

Saturday, October 3, 2015

Write a program to take marks of 15 students and print them out in descending order of marks.

Solution:-
     #include<stdio.h>
     #include<conio.h>
     void main( )
     {
            int a[15],temp=0,i,j;
            clrscr( );
            printf("Enter the 15students marks : \n");
            for(i=0;i<15;i++)
            {
                      printf("\n Enter the mark %d \t",i+1);
                      scanf("%d",&a[i]);
             }
             for(i=0;i<15;i++)
             {
                      for(j=i+1;j<15;j++)
                      {
                                 if(a[i]<a[j])
                                 { 
                                           temp=a[i];
                                           a[i]=a[j];
                                           a[j]=temp;
                                  }
                       }
             }
             printf("\n The marks in desending order are : \n");
             for(i=0;i<15;i++)
             {
                        printf("%d \t",a[i]);
             }
             getch( );
     }

 

Friday, October 2, 2015

What is Internet Protocol Television (IPTV)? Describe Features.

Solution:-
                 Internet Protocol television (IPTV) is the process of transmitting and broadcasting television programs through the Internet using Internet Protocol (IP). IPTV gives dynamic features to the user to improve the user experience compared to a traditional television transmission such as radio frequency broadcast, satellite broadcast and/or cable television. A broadband connection is used as the medium of transmission for IPTV, which is very efficient compared to earlier transmission modes.


Main feature of  IPTV
  1. VOD: Video on demand (VOD) is an option available to the users of IPTV. Each user is given the option to choose from a catalog of videos and watch them as many times as required. This feature uses unicast transmission, whereas normal TV broadcasts use multicast transmission. Real Time Streaming Protocol is used for VOD.
  2. DVR: IPTV allows users to watch TV shows broadcast in the past using digital video recorder (DVR), which is also known as time shifted programming. Providers of IPTV allow users to watch recorded shows without DVR devices. There is a live DVR system at the provider’s end, making DVR more cost effective and efficient. Users can watch replays or start a TV program over from an interactive menu.
  3. Live Television: IPTV allows users to watch live transmissions with minimal latency. It provides live television broadcasts either with or without interactivity, without being just like traditional TV broadcasts. The protocol used for live television is Internet Group Management Protocol (IGMP) version 2.

Write a program to reverse an integer number. (Hint: if number is 135, it should be displayed as 531)

Solution:-
     #include<stdio.h>
     #include<conio.h>
     void main( )
     {
             clrscr( );
             long int num,rem;
             printf("Enter the integer number: \n");
             scanf("%ld",&num);
             while( num ! = 0 )
             {
                       rem = num % 10 ;
                       printf("%ld",rem);
                       num=num/10;
              }
              getch( );
     }