| Back to Questions Page |
| |
| Question |
program that will accept any name and will be stored in an
array |
Rank |
Answer Posted By |
|
Question Submitted By :: Sharky |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | this code is in c#
//i will store a name of 4 letters
string []name= string[5];
Console.WriteLine("Enter your name plz only 4 words");
for(int i=0;i<4;i++)
{
name[i]=Console.ReadLine();
}  |
| Manish Kumar |
| |
| |
| Answer | char a[10];
cout<<" enter any name please";
for(int i=0;i<9;i++)
{
cin>>a[i];
}  |
| Gunda Raj |
| |
| |
| Question |
how to write a program to accept names and marks of 10
students from the user and display the names and markes of
only the passed students. Marks greater than or equal to
35 is considered as pass. |
Rank |
Answer Posted By |
|
Question Submitted By :: Nl |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | #include<stdio.h>
void main()
{
char names[10][20];
int a[10][2],n;
printf(":enter the number of students :");
scanf("%d",&n);
printf("enter the names and marks");
for(int i=0;i<n;i++)
{
scanf("%s",names[i]);
scanf('%d",&a[i]);
}
printf("the passed students are :\n");
for(int i=0;i<n;i++)
{
if(a[i]>=35)
{
printf("%s",names[i]);
}
}
getch();
}  |
| Vignesh1988i |
| |
| |
|
|
| |
| Question |
Exception in thread "main" java.lang.OutOfMemoryError: Java
heap space: |
Rank |
Answer Posted By |
|
Question Submitted By :: Laxmanit08 |
| This Interview Question Asked @ TCS |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | hi friends wht is my task is data is transfered one
db.tables to another db.tables
in tht i write a query check the backup compare to live wht
ever new rows tht will be inserted into backup in tht min of
data means it's wrkg .heavy data means it's not wrkg tell me
the reason how to solve this problem plzzzzzzzz
import java.util.*;
import java.sql.*;
import javax.sql.*;
public class connection
{
public static void main(String[] args)
{
try
{
Class.forName("com.mysql.jdbc.Driver");
Connection con =
DriverManager.getConnection("jdbc:mysql://localhost:3306/testback","root","root");
Statement stmt=con.createStatement();
String payment_date=null;
String payment_ids=null;
ResultSet rs=stmt.executeQuery("select
payment_id,payment_date from care_billing_payment order by
payment_id desc limit 1");
if(rs.next())
{
payment_date= rs.getString("payment_date");
payment_ids= rs.getString("payment_id");
}
System.out.println(payment_date);
System.out.println(payment_ids);
con.close();
Vector v = new Vector();
if(payment_date!=null && payment_ids!=null)
{
System.out.println("Live Database");
Connection con1 =
DriverManager.getConnection("jdbc:mysql://localhost:3306/testlive","root","root");
Statement stmt1=con1.createStatement();
String sql1 = "SELECT
payment_id,payment_encounter_nr,payment_date,status,final_settlement
FROM care_billing_payment where payment_id >
'"+payment_ids+"' order by payment_id asc";
ResultSet rs1=stmt1.executeQuery(sql1);
while(rs1.next())
{
Hashtable h = new Hashtable();
long payment_id= rs1.getLong("payment_id");
System.out.println(payment_id);
String payment_id1 =
String.valueOf(payment_id);
long payment_encounter_nr =
rs1.getLong("payment_encounter_nr");
System.out.println(payment_encounter_nr);
String number =
String.valueOf(payment_encounter_nr);
h.put("payment_id",payment_id1);
h.put("payment_encounter_nr",number) ;
h.put("payment_date",(String)rs1.getString("payment_date"));
h.put("status",(String)rs1.getString("status"));
h.put("settlement",(String)rs1.getString("final_settlement"));
//
h.put("payment_cash_amount",rs1.getString("payment_cash_amount"));
// h.put("payment_receipt_nr",number1) ;
v.addElement(h);
}
con1.close();
}
Connection con2 =
DriverManager.getConnection("jdbc:mysql://localhost:3306/testback","root","root");
//Connect to demobilldb Data source
System.out.println("BackUp Database");
for(int i=0;i<v.size();i++)
{
Hashtable h1 = (Hashtable)v.elementAt(i);
String payment_id =
(String)h1.get("payment_id");
long payment_id1 =Long.parseLong(payment_id);
String encounter_nr =
(String)h1.get("payment_encounter_nr");
long encounter_nr1
=Long.parseLong(encounter_nr);
String status = (String)h1.get("status");
String settlement =
(String)h1.get("settlement");
String date = (String)h1.get("payment_date");
//String amount =
(String)h1.get("payment_cash_amount");
//String receipt_nr =
(String)h1.get("payment_receipt_nr");
// long receipt_nr1 =Long.parseLong(receipt_nr);
String sql2="select time_id from calendar
where the_date='"+date+"';";
Statement stmt2=con2.createStatement();;
ResultSet rs2 = stmt2.executeQuery(sql2);
int time_id=0;
if(rs2.next())
time_id=rs2.getInt(1);
PreparedStatement prpStmt =
con2.prepareStatement("insert into care_billing_payment
(payment_id,payment_encounter_nr,status,final_settlement,payment_date,time_id)
values(?,?,?,?,?,?)");
prpStmt.setLong(1,payment_id1);
prpStmt.setLong(2,encounter_nr1);
prpStmt.setString(3,status);
prpStmt.setString(4,settlement);
prpStmt.setString(5,date);
prpStmt.setInt(6,time_id);
// prpStmt.setString(6,receipt_nr1);
prpStmt.executeUpdate();
if(status.equals("paid") &&
settlement.equals("4"))
{
prpStmt = con2.prepareStatement("update
care_billing_payment set status=? where
payment_encounter_nr=?");
prpStmt.setString(1,status);
prpStmt.setLong(2,encounter_nr1);
prpStmt.executeUpdate();
}
}
/*{
String sql5="select * from calendar;";
Statement stmt5=con2.createStatement();
ResultSet rs5 = stmt5.executeQuery(sql5);
while(rs5.next())
{
int id5=rs5.getInt(1);
System.out.println(id5);
String date5 = rs5.getString(2);
System.out.println(date5);
String sql6 = "update care_billing_payment set
id='"+id5+"' where payment_date='"+date5+"'";
//String sql6 = "update care_billing_payment
set id='0' where payment_date='2007-11-20'";
Statement stmt6=con2.createStatement();
int i = stmt6.executeUpdate(sql6);
System.out.println(i);
}
}*/
con2.close();
}
catch (Exception e)
{
e.printStackTrace();
}
}
see this my task
}
 |
| Laxmanit08 |
| |
| |
| Question |
1)how i get the current system time using php? |
Rank |
Answer Posted By |
|
Question Submitted By :: Anirban Paul |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | U can done it by using current timestamp option.  |
| Tsu |
| |
| |
| Answer | Using NOW() or Date() you can get current system time.  |
| Somnath |
| |
| |
| Answer | <?php
$time_offset ="525"; // Change this to your time zone
$time_a = ($time_offset * 120);
$time = date("h:i:s",time() + $time_a);
echo 'Current time is : '.$time;
?>  |
| Ishtiaq Alam |
| |
| |
| Question |
Hi
I have a dynamic dropdown reading in data from a MQSql
database, I need to refresh just the dropdown (not the
whole page) for any new values in the database. I am trying
to use the getElementById in javascript but I have no idea
how to get it to refresh.
Does any one have an examples or any ideas how this can be
done?
Regards
Srilanka_3 |
Rank |
Answer Posted By |
|
Question Submitted By :: Srilanka_3 |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | Hi
I have a dynamic dropdown reading in data from a MQSql
database, I need to refresh just the dropdown (not the
whole page) for any new values in the database. I am trying
to use the getElementById in javascript but I have no idea
how to get it to refresh.
Does any one have an examples or any ideas how this can be
done?  |
| Imrankhan |
| |
| |
| Answer | Hello,
Ajax will be better solution for you.
1st set your Drop down in a particular Div tag and refresh
this div tag with new Drop Down HTML.
Regards,
Dipesh  |
| Dipeshpatel |
| |
| |
| Question |
If basic HR function like recruitment, training are
outsoureced then, why do companies have their own HR
department? |
Rank |
Answer Posted By |
|
Question Submitted By :: Manasi |
| This Interview Question Asked @ Wellspring |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | Hi, Friends
HR Department is the backbone of the company. it have more
importance in the company. through the HR function
recruitment the company select the good employee for the
organisation. without proper recruitment process recruiter
can't select teh suitable candidates for the company
requirement. so in every company HR department is most
important  |
| Anita |
| |
| |
| Question |
could you please tell me
for what
javac, javax,swing,awt.*;
are using.
what is the meaning and differences.
and also
there are 4 access modifiers in java.
public, private, protected, default.
what is the meaning of these 4 access modifiers and
difference.
public is the access modifier
void means return data type
disp() means function name
what mean by static |
Rank |
Answer Posted By |
|
Question Submitted By :: Shnth_166 |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | javac is an copiler it compiles the actual .java file into
byte code formate.
javax.swing,awt those are packages the basic difference is
awt using system graphical user interface but swing use it's
won graphical user interface.
public means u can access the anywhere outside the class also.
private mean u ca access the variable and methods inside the
class only.
protect variable can access sub class also but not other
than sub class.
static means it maintain one copy for all.that means any
object for particular class static variable will one to
all object of that class.
Regards,
NageswaraRao.  |
| Nageswararao |
| |
| |
| Question |
The sum of three numbers is 20. The second number is 4
times the first number , and the sum of the first and third
is8. Find the numbers. |
Rank |
Answer Posted By |
|
Question Submitted By :: Guest |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | Three numbers are x , y , z ;
So ,
x + y + z = 20;
4x = y;
x+ z= 8;
therefore ,
8+y=20;
y = 12, x= 3 ,z= 5;  |
| Neeraj Venu |
| |
| |
| Answer | x,y,z
1: x+y+z=20
2: y=4x
3: x+z=8
so:
x+4x+8-x=20
4x=12 so x=3
y=4*3 so y=12
z=8-x so z=5  |
| Vinod |
| |
| |
| Answer | The nos are 2,8,5......
solution...
x+4y+z=20;
but.. x+z=8;
so..4y+8=20;
so..y+2=10;
so..
y=8;  |
| Mariaalex007 |
| |
| |
| Question |
How to write a reusable function for testing an "Button"
Objects in a page without passing the page name to a
function? (Think if page names are dynamic and doesn't have
any pattern matching between each page). Send me code which
works in QTP 9.2..... |
Rank |
Answer Posted By |
|
Question Submitted By :: Rashmi |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | use regular expressions for tht...if necessary..revert back
i'll know u the code for tht  |
| Krishna |
| |
| |
| Answer | KINDLY PROVIDE THE FUNCALITY OF BUTTON, WOULD U LIKE TO USE
THIS BUTTON WITH SAME FUNCALITY ON ANY WEB PAGE !!  |
| Manish Kumar |
| |
| |
| Question |
how to use textfile for taking value for parametrization
instead of datatable or global sheet |
Rank |
Answer Posted By |
|
Question Submitted By :: Guest |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | open notepad enter the following:
name (press tab)mark
ram (presstab)45
priya(press tab) 56
save the file as .txt
open the tool:
right click in the first cell and select import file
select the saved notepad file
now the entered values have been populated in the datatable  |
| Sunitha S |
| |
| |
| Answer | Hi Sunitha
u r not Correct!
Username Password
chaitu mercury
vamci mercury
This is Actually Procedures
Set fso = CreateObject("Scripting.FileSystemObject")
Set fs = fso.OpentextFile("Path of the file")
While AtendoftheLine <> 0
f = fs.ReadLine
x = split(f," ")
Msgbox x(0)
Msgbox x(1)
Browser(Browser).Page(Page).WebEdit(username).Set x(0)
Browser(Browser).Page(Page).WebEdit(Passwrod).Set x(1)
wend
i think its working try this.........  |
| Chaitu |
| |
| |
| Question |
How to Connect and Insert Record to MYSQL using PHP? |
Rank |
Answer Posted By |
|
Question Submitted By :: Solidcube |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | $conn = mysql_connect("localhost","root","");
mysql_select_db("database_name",$conn); // Connection....
if($hh){
$res = mysql_query("insert into `table`(`all
paramaeters of table`)values('','','')");
}
$res1 = mysql_query("select * from `table`");
// Insert Module....  |
| Satyajit Das |
| |
| |
| Answer | <?php
//var_dump($_POST);
//die();
$link=mysql_connect("localhost","root","");
$db=mysql_select_db("emp",$link);
$id=$_POST['id'];
$name=$_POST['name'];
$age=$_POST['age'];
$phone=$_POST['phone'];
$salary=$_POST['salary'];
$address=$_POST['address'];
$query="insert into db(id,name,age,phone,salary,address)
values
('".$id."','".$name."','".$age."','".$phone."','".$salary."'
,'".$address."')";
//echo $query;
mysql_query($query);
echo "<B></B>DATA ADDED SUCCESSFULLY<B></B>";
?>  |
| Mukesh Bisht |
| |
| |
| Answer | To
Connect="$dblink=mysql_connect("127.0.0.1","mediamagick","mediamagick");
$db_conn=mysql_select_db("mediamagick_italy",$dblink)or
die("could not connect");"
And To Insert = "Select (Field Names) values (values to
insert )";  |
| Sudhanshu |
| |
| |
| Answer | <?php
->connection parts-------
mysql_connect("<webser-name>","user-name","password-name");
mysql_select_db("<database-name>");
->insertion parts--------
$r=mysql_query("insert into <table-name> values(fild
name)");
if($r)
{
print "<h1>insert successfully";
}
else
{
print"<h1>insert not successfully";
}  |
| Anirban Paul |
| |
| |
|
| |
|
Back to Questions Page |