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

program to find error in linklist.(i.e find whether any node point wrongly to previous nodes instead of next node)

2097


Why is not a pointer null after calling free?

1026


What could possibly be the problem if a valid function name such as tolower() is being reported by the C compiler as undefined?

1283


void main(int n) { if(n==0) return; main(--n); printf("%d ",n); getch(); } how it work and what will be its output...............it any one know ans plz reply

2794


What are high level languages like C and FORTRAN also known as?

1176


What are volatile variables in c?

953


Define recursion in c.

1287


Can a variable be both static and volatile in c?

1044


Is exit(status) truly equivalent to returning the same status from main?

1077


Explain what are compound statements?

1063


Can a void pointer point to a function?

1026


How macro execution is faster than function ?

1198


How can you find the day of the week given the date?

1204


What are identifiers and keywords in c?

1106


What is data structure in c programming?

1081