Thursday, April 19, 2012

VB Script -Programs

  1. *
    **
    ***
    Please write a code to get output like above diagram.
for i=1 to 3 step 1
  for j=1 to i step 1
    vstr=vstr&"*"
  next
   vstr=vstr&vbnewline
next
msgbox vstr
  1. sunday is sunday
    monday
    tuesday
    wendesday
    sunday
    thursday
    friday
    saturday
    sunday
    sunday

    how to count no of sunday in the text file from vb?
Set fso=createobject("scripting.filesystemobject")
Set forread=fso.OpenTextFile("path\test.txt",1)
text=forread.ReadAll
coun=ubound(split(text,"sunday"))
msgbox coun

3. int a=4857 i need output as 7584.without using any inbuild function?
var=4857 For i=1 to len(var) x=var mod 10 num=num&x var=var/10 var=fix(var) Next msgbox num

2 comments:

  1. Hi

    I read this post two times.

    I like it so much, please try to keep posting.

    Let me introduce other material that may be good for our community.

    Source: Product controller interview questions

    Best regards
    Henry

    ReplyDelete
  2. Every source code written in Java is written first using plain text documents within the Java programming language, ending with a .java extension. It is possible to write it using any text editor or notepad. These source files are transformed into .class files using Javac's compiler. A .class file doesn't contain the native code of your processor. Instead, it contains bytecodes that are part of the machine language used by the Java Virtual Machine1 (Java VM). The Java Launcher tool executes your program using an actual instance of it. Java Virtual Machine. So, the java platform is dependent.

    ReplyDelete