ishaan.guliani
BAN USER
Comments (3)
Reputation 0
Page:
1
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
0
of 0 vote
Below code will help -
#!/usr/bin/ksh
myhosts=(ishaan-Inspiron-7720 host1 host2)
user="ishaan"
echo "List of hosts ==>> "${myhosts[@]}
for i in ${myhosts[@]}
do
ssh -l $user $i "grep 'Error' /opt/NWMats/logs/*20150509*log 2>&1" >> mylogs.txt
done
Comment hidden because of low score. Click to expand.
0
of 0 vote
#include <stdio.h>
#include <string.h>
int maxdivide(int value, int exp)
{
while(value%exp==0)
value = value/exp;
return value;
}
int isUgly(int num)
{
num = maxdivide(num,2);
num = maxdivide(num,3);
num = maxdivide(num,5);
if (num == 1) return 1;
else return 0;
}
int main(void)
{
int val=301;
if (isUgly(val) == 1) printf("%d is a ugly number",val);
else printf("%d is not a ugly number",val);
return 0;
}
Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
- ishaan.guliani September 16, 2015