//=indicating you to do the programming part on your own relating to the description provided against. This done because different programming languages require different coding for that.
n=integer value
n1=dummy storage for n
r=variable used to do the function
{
int n,r,n1,rev=0;
//do the coding here for storing the integer in the variable n
n1=n;
while(n>0){
r=n%10;
rev=(rev*10)+r;
n=n/10;
}
//now add a command for displaying the value of rev
}
this is just a logic i used for java
done.
Answer:
Boot Sector virus is when a virus infects the Boot Sector of a hard disk. A Boot Sector is the initial files necessary to start an OS and other bootable programs. It is typically infected by these viruses when started with infected floppy disks, however the boot virus does not have to be successful to infect your computer. Once infected, the virus tries to infect every other disk.
Hope this helps!
Answer and Explanation:
Using javascript:
function dayof_theweek(){
var TodayDate = window. prompt("enter today's date in the format 'year, month, day' ");
var Datenow=new date(TodayDate);
var Dayofweek=Datenow.getday();
var Days=["monday","Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"];
if(Dayofweek==indexOf(Days[Dayofweek]))
{
document.createTextnode(Days[Dayofweek]);
}
}
The program above uses a date object which uses the method getday to get the day of the week(get day returns an integer from 0 to 6).we then use a comparison operator == to test the condition that returned value Dayoftheweek is same with the index of the array Days and then print to a html document. The program may need improvements such as the fact that errors may arise when proper input isn't given, and therefore must be handled.