+ 1
Pattern in c using alternate stars
*?*? ?*?* *?*? ?*?* write the code to print this pattern
5 Réponses
+ 4
@Megha, you already have understood the logic for the task, I would encourage you to try to implement that logic into code (language of your choice), then if you're having difficulties yo can link the code with a question so everyone can see : )
P.S. I see you didn't tag any language, it's necessary so people can understand which language is preferred for solution.
+ 3
What is your Question???
+ 1
can anyone help me to print this pattern
+ 1
in linux the answer will be:-
echo "enter no of rows"
read n
for((i=1; i<=n; i++))
do
for((j=1; j<=n; j++))
do
k=`expr $i + $j`
if test `expr $k % 2` -eq 0
then
echo -e "*\c"
else
echo -e "?\c'
fi
done
echo " "
done