Write a program that completed following tasks on string. Given string is “DBJ College ,Chiplun DBJ DBJ” . 1) find the occurrence of “D’ in given string. 2) Find the occurrences of “DBJ” in given string. source file name: findchar.C #include<stdio.h> #include<string.h> int main() { …
Read moresource file name: strcopy.C #include <string.h> #include<stdio.h> int main() { char str1[100], str2[100], i; //clrscr(); printf("Enter first string : "); gets(str1); for (i = 0; str1[i] != '\0'; ++i) { str2[i] = str1[i]; } str2[i] = '\0'; …
Read moresource file name: palindr.C #include <string.h> #include<stdio.h> int main() { char str[20]; int i, len; int op = 0; //clrscr(); printf("Enter a string:"); scanf("%s", str); len = strlen(str); for(i=0;i < len ;i++) { if(str[i] != str[len-i-1]) …
Read more5) Write a program that checks input string is Palindrome or not using reverse function.
A string is said to be palindrome if reverse of the string is same as string source file name: palindr2.C #include<string.h> void main() { char str1[20]; char str2[20]; char str[20]; int n; clrscr(); printf("\n Enter a String: "); scanf("%s",str1); strcpy(str,str1); strcpy(str2,strrev(str1)…
Read more<!DOCTYPE html> <!-- To change this license header, choose License Headers in Project Properties. To change this template file, choose Tools | Templates and open the template in the editor. --> <html> <head> <title>JSP program for Users</title> </head>…
Read more7) Write a Servlet program that accepts input single and multiple parameters from HTML form.
source file name: MultiSelection.html <html> <head> <title>Multi Selected Control </title> </head> <body> <form action="http://localhost:8080/ServletPrgs/MiltiselectionServlet" method="post" > Name: <input type=&…
Read more4) Write a program that sorts given strings using two dimensional array for storing strings.
source file name: sortstrings.C #include <string.h> #include <stdio.h> int main() { char temp[10]; int i,j,n; char names[10][10]={"Raju","Harish","Kailas","Arun,","Satish", "Jayvant","Rajendra","Suresh","Prashant",&…
Read moresource file name: lwruprstr.C #include<string.h> void main() { char str1[20],str2[20]; clrscr(); printf("enter first string: "); gets(str1); printf("enter second string: "); gets(str2); printf(" \n converted Lower case string is: %s", strlwr(str1)); printf(" \n converted Uppe…
Read moresource file name: CookieServlet.java import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet…
Read moresource file name: SessionServlet.java import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import j…
Read more14) Write a program that determine sum of two Matrices 3 X 3 order . The program should display all three Matrices.
source file name: Matadd.C #include <stdio.h> int main() { int i,j; int A[3][3]={{1,2,3},{4,5,6},{7,8,9}}; int B[3][3]={{2,2,2},{3,6,9},{10,20,30}}; int C[3][3]; //clrscr(); printf("\n given Matrix A \n"); for(i=0;i<3;i++) { for(j=0;j<3;j++) { printf("%d ",A[i][j]); } printf("\n&…
Read more13) Write a program that displays 2D Matrix which takes input rows and columns of Matrix.
source file name: Matrix1.C #include<stdio.h> int main() { int row,col; int i,j,sum=0,avg; int A[10][5]; //clrscr(); printf("\n enter no. of rows "); scanf("%d",&row); printf("\n enter no. of columns "); scanf("%d",&col); for(i=0;i<row;i++) { printf("\n …
Read more12)Write a program to find average marks of 4 different subjects obtained by 10 student in a test using two dimensional array.
Write a program to find average marks of 4 different subjects obtained by 10 student in a test . Use two dimensional array to store marks of student for each subject. source file name: arr2davg.C #include<stdio.h> int main() { int i,j,sum=0,avg; int stud[10][5]={ {501,15,15,15,15},{502,16,16,16,16},{503,15,16,…
Read more11) Write a program to find average marks obtained by 10 student in a test . Use array to store marks of student.
source file name: arravg.C void main() { int i,n,sum=0,avg; int A[20]; clrscr(); printf("\n enter marks out of 25 "); printf("enter no. of students attempted in Test <20:\n"); scanf("%d",&n); for(i=0;i<n;i++) { printf("\n enter marks of %d student: ",i+1); scanf(&quo…
Read more2) Write a JSP program that checks given number is Prime number or not. The number is accept from html form.
source file name: Primeno.html <html> <head> <title>Prime no JSP program</title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width"> </head> <body> <form action="ht…
Read moresource file name: DateJsp.jsp <%@page import="java.util.Date"%> <%@page contentType="text/html" pageEncoding="UTF-8"%> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Date…
Read more7) Write a program that converts decimal integer number to binary equivalent using Array.
source file name: BinaryConv.C void main() { int i,n; int rem[15];; clrscr(); printf("enteu any Natural number :\n"); scanf("%d",&n); i=0; while(n>0) { rem[i]=n%2; n=n/2; i++; } printf("\nBinary Conversion :\n"); for(i=i-1;i>=0;i--) printf("%d ",rem[i]); getch(); } …
Read more8) Write a program that converts decimal integer number to Octal equivalent using Array.
source file name: Conv8.C void main() { int i,n; int rem[15];; //clrscr(); printf("\n enteu any Natural number :\n"); scanf("%d",&n); i=0; while(n>0) { rem[i]=n%8; n=n/8; i++; } printf("\n Octal Conversion :\n"); for(i=i-1;i>=0;i--) printf(" %d ",rem[i]); getch(); …
Read more10)Write a program that converts any decimal integer number to binary, octal and hexadecimal equivalents using function that converts decimal number to any base equivalent.
source file name: Convallfn.C void main() { void conv(int n, int b); int n; clrscr(); printf("\n enteu any Natural number :\n"); scanf("%d",&n); conv(n,2); conv(n,8); conv(n,16); getch(); } void conv(int n, int b) { int rem[15]; int i=0; while(n>0) { rem[i]=n%b; n=n/b; i++; } if(b==2) prin…
Read more9) Write a program that converts decimal integer number to Hexadecimal equivalent using Array.
source file name: Conv16.C void main() { int i,n; int rem[15];; clrscr(); printf("\n enteu any Natural number :\n"); scanf("%d",&n); i=0; while(n>0) { rem[i]=n%16; n=n/16; i++; } printf("\n Octal Conversion :\n"); for(i=i-1;i>=0;i--) { switch(rem[i]) { case 10:printf("A …
Read more6)Write a program that sorts given integers and display in Ascending order also print the integers in Descending order.
source file name: ArrSort.C void main() { int i,j,temp; int A[]={11,-20,23,77,-18,134,-53,500,6,100}; clrscr(); printf("unsoted given array numbers no :\n"); for(i=0;i<10;i++) printf("%d ",A[i]); for(i=0;i<10;i++) { for(j=0;j<10;j++) { if(A[i]>A[j]) { temp=A[i]; A[i]=A[j]; A[j]=temp; }…
Read more4) Write a Servlet program that calculates Factorial value of number. The number accept from html form.
source file name: Fact.html <html> <head> <title>Factorial program for Servlet</title> </head> <body> <form action="http://localhost:8080/ServletPrograms/FactServlet" method="post"> enter any no: …
Read more<html> <head> <title>Factorail program for Servlet</title> </head> <body> <form action="http://localhost:8080/ServletPrograms/LoginServlet" method="post"> enter User Name: <input type="…
Read moreNetBeans IDE File Contents: Source file name: DateServlet.java import java.io.IOException; import java.io.PrintWriter; import java.util.Date; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import …
Read moresource file name: FirstServlet.java NetBeans IDE file contents: import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.Ht…
Read moreWrite a program that displays sum of all given array numbers. Given array numbers are: 100,150,-170,240,120 source file name: Arraysum.C void main() { int S[]={100,150,-170,240,120}; int i,sum=0; clrscr(); printf("\nArray numbers are: "); for(i=0;i<5;i++) { printf(" %d ",S[i]); } printf("…
Read moreWrite a program that finds and print each array element added by 7 value. Given array numbers are:10,15,20,25,30. source file name: Arradded.C #include<stdio.h> int main() { int P[]={10,15,20,25,30}; int i; //clrscr(); printf("\nArray numbers are: "); for(i=0;i<5;i++) { printf(" %d ",P[…
Read more3)Write a program that finds and displays square and cubes of each array element.
Write a program that finds and displays square and cubes of each array element. Given array numbers are : 10,15,-17,24,12 source file name: Arrsqcube.C #include<stdio.h> int main() { int A[]={10,15,-17,24,12}; int i,sq,c; //clrscr(); printf("\nArray numbers are: "); for(i=0;i<5;i++) { printf(&quo…
Read more12) Write a program that convert Decimal number into Roman equivalent using function.
Write a general-purpose function to convert any given year into its roman equivalent. The following table shows the roman equivalents of decimal numbers. Decimal Roman Decimal Roman Decimal Roman 1 I 5 V 10 X 50 L 100 C 500 D 1000 M Example: Roman equivalent of 1988 is MDCCCCLXXXVIII Roman equivalent of 1525 is MDX…
Read more11) Write a program that obtain the prime factors of given number using Function.
A positive integer is entered through the keyboard. Write a function to obtain the prime factors of this number . for example: Prime factors of 24 are 2,2,2 and 3 and whereas prime factors of 35 are 5 and 7. source file name: PrimeFactors.C void primefactor(int n) { int d; d=2; while(d<=n) { if(n%d==0) { printf(&q…
Read more