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

If a variable is a pointer to a structure, then which operator is used to access data members of the structure through the pointer variable?

0 Answers  


write a program in reverse the string without using pointer,array,global variable declaration,lib fun only using a function?

5 Answers   HCL,


how can i print "hello"

3 Answers  


Study the Following Points: a.One Cannot Take the address of a Bit Field b.bit fields cannot be arrayed c.Bit-Fields are machine Dependant d.Bit-fields cannot be declared as static 1. Which of the Following Statements are true w.r.t Bit- Fields A)a,b&c B)Only a & b C)Only c D)All

3 Answers   Accenture,


enum { SUNDAY, MONDAY, TUESDAY, }day; main() { day =20; printf("%d",); getch(); } what will be the output of the above program

1 Answers  


What is the size of a union variable?

0 Answers  


what is mallloc()?how it works?

4 Answers   Excel,


Q. where is the below variables stored ? - volatile, static, register

3 Answers   Bosch,


what are bps & baud rates? differentiate these two?

2 Answers   TCS,


What is a null pointer assignment error? What are bus errors, memory faults, and core dumps?

0 Answers   Aspire, Infogain,


for(;;) printf("C language") What is out put of above??

2 Answers   Practical Viva Questions,


Where define directive used?

0 Answers  


Categories