Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

print the pattern 1
2 4
3 6 9
4 8 12 16
5 10 15 20 25
if n=5

Answer Posted / akshay chinche

#include<stdio.h>

int main()
{
int i,j,k,n=5,temp=2,fix;
fix=k=1;

for(i=1;i<=4;i++)
{
fix++;
k=fix;
for(j=1;j<=n;j++)
{
if(j<=i+1)
{
printf("%d ",k);
k=k+temp;
}
}

k=0;
temp++;
putchar (10);
}
return 0;
}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is c procedural or object oriented?

1092


List the difference between a 'copy constructor' and a 'assignment operator' in C?

1144


What is the size of structure in c?

1216


How can I write a function that takes a format string and a variable number of arguments?

1105


Differentiate between #include<...> and #include '...'

1117


Can a pointer be static?

1134


What are the advantages of c language?

1155


exit () is used to a) exit () terminates the execution of the program itself b) exit () terminates the execution of the loop c) exit () terminates the execution of the block d) none of the above

1185


How do we print only part of a string in c?

1083


What do you mean by command line argument?

1231


write a program in c language to print your bio-data on the screen by using functions.

6841


What are the loops in c?

1054


What are lookup tables in c?

1037


in any language the sound structure of that language depends on its a) character set, input/output function, its control structures b) character set, library functions, input/output functions its control structures c) character set, library functions, control sturctures d) character set, operators, its control structures

1258


What is sizeof array in c?

1117