Posts

Important patterns for IPLC Practical exam with solution

1)Write a program to print following pyramid.  *  * *  * * *  * * * * Ans : #include<stdio.h> #include<conio.h> void main() { int num,row,col,space; clrscr(); printf("Enter a num = "); scanf("%d",&num); for(row=1;row<num;row++) { for(space=num-1;space>row;space--) { printf(" "); } for(col=1;col<=row;col++) { printf(" *"); } printf("\n"); }          gotoxy(60,20);     //this is optional part printf("By Aaftab");//this is optional part         getch(); } 2)Write a program that accepts an integer N, if the integer N = 4,then print the pyramid :  1  121  12321  1234321 Ans : #include<stdio.h> #include<conio.h> void main() { int row,col,k,num,a,b,c; clrscr(); printf("Enter a num = "); scanf("%d",&num); for(row=1;row<num;row++) { for(col=1;col<=row;col++) { printf("%d",col)...

IPLC unit 3 solution with .c extenton file download link

1 Write a program to find sum of N numbers. Ans : #include<stdio.h> #include<conio.h> void main() { int n,no,sum=0,i; clrscr(); printf("Enter how many number you want to sum = "); scanf("%d",&n); for(i=1;i<=n;i++) { printf("Enter No %d = ",i); scanf("%d",&no); sum=sum+no; } printf("Sum = %d",sum);          gotoxy(60,20);     //this is optional part printf("By Aaftab");//this is optional part         getch(); } Click here to downlaod .c file 2 Write a program to find factorial of given number. Ans : #include<stdio.h> #include<conio.h> void main() { int i,fact=1,num; clrscr(); printf("Enter a number = "); scanf("%d",&num); for(i=num;i>0;i--) { fact=fact*i; } printf("\n Factorial = %d",fact);          gotoxy(60,20);     //this is optional part printf("By Aaftab");//this is optional ...

CPRG Unit 2 programe with solution

1.Write a program to accept number of seconds and display its corresponding hours, minutes and seconds . 2. Write a C program to find the maximum from given three numbers (Using Nested IF). 3. Write a C program to find that the accepted no is Negative, Positive or Zero. 4. Write a program to check given year is a Leap year or not. 5. Write a C program to find minimum from given 3 numbers (Using Conditional Operator). 6. Write a C program to find the maximum from given three numbers (Without using Nested if, or Logical Operator, Or Conditional operators). 7. Take marks from the user and print grade accordingly( >=75 marks – Distinction, <75 and >=60 marks – First, <60 and >=50 – Second, <50 and >=35 – Pass, <35 – Fail) using if … else if….else statement and also by using logical operators). 8. Take 2 numbers from the user and print the greater number (Number can be equal). 9. Write a program to check whether the blood donor is eligible or not for donatin...

HTML Table Excersice

Table Excersice 1  : Click Here to Download the word file of questions.... For solution Also availible .html file  extention Click here.... Table Excersice 2  : Click Here   to Download the word file of questions.... For solution Also availible .html file  extention  Click here....

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