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

Answers were Sorted based on User's Feedback



print the pattern 1 2 4 ..

Answer / murthyknm

public class Pattern
{
public static void main(String args[])
{
for(int i=1;i<=5;i++)
{
for(int j=1;j<=i;j++)
{
System.out.print(i*j+" ");
}
System.out.println();
}
}
}

Is This Answer Correct ?    2 Yes 1 No

print the pattern 1 2 4 ..

Answer / vamsi talapatra

#include<iostream>
using namespace std;
int main(){
int n = 1;
int l = 1;
while(n<=5){
for(int i = 1; i<=l; i++){
cout<<n*i<<" ";
}
cout<<endl;
l++;
n++;
}
return 0;
}

Is This Answer Correct ?    1 Yes 0 No

print the pattern 1 2 4 ..

Answer / 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

More C Interview Questions

Is it fine to write void main () or main () in c?

0 Answers  


Why is c called a mid-level programming language?

0 Answers  


what is data structure

5 Answers   Maveric, TCS,


Explain the difference between struct and union.

2 Answers  


What library is sizeof in c?

0 Answers  


Tell me what is the purpose of 'register' keyword in c language?

0 Answers  


What are header files in c?

0 Answers  


a sequence of bytes with one to one corrspondence to those in the external device a) sequential addressing b) address c) byte code d) none

0 Answers  


how would a 4*3 array A[4][3] stored in Row Major Order?

0 Answers   HCL, Ignou,


Please list all the unary and binary operators in C.

3 Answers  


Please provide question papers of NATIONAL INFORMATICS CENTRE for Scientific officer

0 Answers  


WHAT IS THE DEFINATION OF IN TECHNOLOGY AND OFF TECHNOLOGY ?

0 Answers   HP,


Categories