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
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 |
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 |
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?
write a program in reverse the string without using pointer,array,global variable declaration,lib fun only using a function?
how can i print "hello"
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
enum { SUNDAY, MONDAY, TUESDAY, }day; main() { day =20; printf("%d",); getch(); } what will be the output of the above program
What is the size of a union variable?
what is mallloc()?how it works?
Q. where is the below variables stored ? - volatile, static, register
what are bps & baud rates? differentiate these two?
What is a null pointer assignment error? What are bus errors, memory faults, and core dumps?
for(;;) printf("C language") What is out put of above??
2 Answers Practical Viva Questions,
Where define directive used?