AMCAT Automata Previous Questions | AMCAT Previous Coding Questions
Q1. Write a C program to print below,when n=4 and s=3
3
44
555
555
44
3
Q2. Write a program to Merge sort using pointers.
Designed by AMCAT DETAILS | TUTORIAL DIARY Copyright © 2014
ANSWER TO 1ST ONE IS
ReplyDelete#include
#include
int main()
{
int i,j;
clrscr();
for(i=3;i<=5;i++)
{
for(j=3;j<=i;j++)
{
printf("%d",i);
}
printf("\n");
}
for(i=5;i>=3;i--)
{
for(j=3;j<=i;j++)
{
printf("%d",i);
}
printf("\n");
}
return 0;
}