Posts

Showing posts from February, 2022

program for to Interchange the number.

  // program for interchange contents.   #include <stdio.h> int main () {     int a = 5 , b = 6 , c = 7 ;     int temp ;     temp = a ;     a = b ;     b = c ;     c = temp ;     printf ( "a=%d,\tb=%d,\tc=%d" , a , b , c ); } /*Output*/ a=6, b=7, c=5

Write the program to receive Cartesian coordinate (x,y) of a point and convert them into polar coordinates (r,c)

/* program to convert Cartesian co-ordinate (x,y) into polar coordinates (r,c) */ #include <stdio.h> #include <math.h> int main () {     int x , y ;     float r , angle ;     printf ( "Enter the value of x and y:" );     scanf ( "%d%d" , & x , & y );     r = sqrt ( pow ( x , 2 ) + pow ( y , 2 ));     angle = atan ( y / x );     angle = angle * 180 / 3.14159265359 ;     printf ( "The coordinate of r,c is (%f,%f)" , r , angle );     return 0 ; } Enter the value of x and y:1 1 The coordinate of r,c is (1.414214,45.000000)  

If a five digit number is input through the keyboard the keyboard ,write a program to calculate the sum of its digits.

  /* program for sum of 5 digit Enter by the user */ #include <stdio.h> int main () {     int sum = 0 , num , i ;     printf ( "Enter the 5 digit number:" );     scanf ( "%d" , & num );     for ( i = 0 ; i < 5 ; i ++ ) //by using for loop     {         sum = sum + num % 10 ;         num = num / 10 ;             }       printf ( "The sum of the number Enter by the user is %d" , sum );     return 0 ; } //output Enter the 5 digit number:12345 The sum of the number Enter by the user is 15

Paper of size A0 has dimensions 1189 mm x 841 mm. each subsequent size A(n) is defined as A(n-1) cut in half parallel to its shorter sides. Thus paper of size A1 would have dimensions 841 mm x 594 mm. write a program to calculate and print paper sizes A0,A1,.....A8.

  // program to calculate the size of paper. #include <stdio.h> int main () {     int w = 841 , h = 1189 , i , temp ;     for ( i = 0 ; i <= 8 ; i ++ )     {         printf ( "A%d:%dmm x %dmm\n" , i , w , h );         temp = h ;         h = w ;         w = temp / 2 ;     }     return 0 ; } // output A0:841mm x 1189mm A1:594mm x 841mm A2:420mm x 594mm A3:297mm x 420mm A4:210mm x 297mm A5:148mm x 210mm A6:105mm x 148mm A7:74mm x 105mm A8:52mm x 74mm

The lenght and breadth of a rectangle and radius of a circle are input through the keyboard . write a program to calculate the area and perimeter of the rectangle and the area and circumference of the circle.

// program to calculate area of rectangle and circle. # include <stdio.h> int main (){     int l , b , r ;     float rectangle , circle , area , perimeter , circumference ;     printf ( "Enter the lenght , breadth:\n " );     scanf ( "%d%d" , & l , & b );     rectangle = l * b ;     perimeter = 2 * ( l + b );     printf ( "The Area of reactangle is %f and\n perimeter of rectangle is %f\n" , rectangle , perimeter );     printf ( "Enter the Radius of the circle:\n" );     scanf ( "%d" , & r );     circle = 3.14 * r * r ;     circumference = 2 * 3.14 * r ;     printf ( "The Area of circle is %f and \nthe circumference of circle is %f" , circle , circumference );     return 0 ; } /*output*/ Enter the lenght , breadth: 2 3 The Area of reactangle is 6.000000 and perimeter of rectangle is 10.000000 Enter the Radius of the circle...

Temperature of a city in Fahrenheit degrees is input through the keyboard . write a program to convert this temperature into Centigrade degrees.

  // program for calculate to convert the temprature. # include <stdio.h> int main (){     float fahrenheit,celsius;     printf ( "Enter the value of fahrenheit :\n" );     scanf ( "%f" , & fahrenheit);     celsius = (fahrenheit - 32 ) * 5 / 9 ;     printf ( "The value of %f degree F is %f  degree C " ,fahrenheit,celsius);     return 0 ; } /*OUTPUT*/ Enter the value of fahrenheit : 65 The value of 65.000000 degree F is 18.333334 degree C

About Telegram

About Telegram  Telegram does not required any machine to be the sender or the receiver . When a message  is to be sent , the sender will put the message in brief , clear and in lesser number of  words  far as possible . Normal  grammar and punctuation may be Ignored. Sentences are divided by the words ‘STOP’.    Advantages of Telegram :  1. Fast service for short message.  2. Written document for legal purpose.  3. Faster than letter carriers .  4. This show that the purpose is very urgent.     Disadvantages of Telegram  1. Not useful for long message.  2. Now SMS of mobiles phones are more faster and direct approaching towards the Target them the telegram.