Showing posts from March, 2021Show all

10)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 more

1) Write a Servlet program that displays simple messages.

source 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 more