Posts

Showing posts from September 29, 2019

CPRG Unit 1 program with solution

Unit 1 programs with solution and .c extention file.. 1.  Find Simple Interest. Inputs are principal amount, period in year and rate of interest. 2.  Find the area and perimeter of square and rectangle. Input the side(s) through the keyboard. 3.  Accept any three numbers and find their squares and cubes. 4. Write a program to enter the temperature in Fahrenheit and convert it to Celsius.[C = ((F-32)*5)/9]. 5.  Write a program to store and interchange two numbers in variables a and b. 6.  Write a program to accept an integer and display it in octal and hexadecimal formats. 7.   Write a program to enter text with gets() and display it using printf() statement also find the length of the text. 8. Write a program to enter two numbers and find the smallest out of them. Use conditional operator. 9. Write a program to enter a number and carry out modular division operation by 2, 3 and 4 and display the ...

HTML Canvas 2

Image
HTML Canvas 2 Code for Canvas 2 <!DOCTYPE html> <html> <head> </head> <body> <p>Canvas</p> <canvas id="myCanvas" height=300 width=500 style="border:2px solid;"> </canvas> <script> var canvas = document.getElementById("myCanvas"); var ctx = canvas.getContext("2d"); ctx.moveTo(0,100); ctx.lineTo(500,100); ctx.moveTo(0,200); ctx.lineTo(500,200); ctx.stroke(); </script> </body> </html>

HTML Canvas

Image
HTML Canvas <!DOCTYPE html> <html> <head> </head> <body> <p>Canvas</p> <canvas id="myCanvas" height=300 width=500 style="border:2px solid;"> </canvas> <script> var canvas = document.getElementById("myCanvas"); var ctx = canvas.getContext("2d"); ctx.moveTo(0,100);1` ctx.lineTo(500,100); ctx.moveTo(0,200); ctx.lineTo(500,200); ctx.stroke(); </script> </body> </html> Click here for download .html text file