Write a Program to print this triangle:
*
**
*
****
*
******
*
********
*
**********
use two nested loops.
Answers were Sorted based on User's Feedback
Answer / manoj
void main() {
int n = 5 ; // take use input here
int i, j;
for( i =1; i<=n; i++){
printf("\n *");
for(j=1; j<i; j++){
printf(" *");
}
}
}
| Is This Answer Correct ? | 8 Yes | 13 No |
Answer / vikram sharma
<?php
for($i=0;$i<10;$i++){
for($j=0;$j<=$i;$j++){
if($i%2!=0 || $i==0 || $j==1)
echo"*";
}
echo"</br>";
}
?>
| Is This Answer Correct ? | 7 Yes | 12 No |
What is indirection?
What is the c language function prototype?
regarding pointers concept
Which command is more efficient? *(ptr+1) or ptr[1]
Why ca not I do something like this?
What is the output of following program ? int main() { int x = 5; printf("%d %d %d\n", x, x << 2, x >> 2); }
One of the Institutes contains 5 student groups. Every group contains 4 students. Institute wants to store student group’s details in array. Group should contain group member’s details (name and registration number and age), project name, and mark of the group.
what is the difference between procedure oriented and object oriented progaming language
what is the output of below code int x=8,y; x>>=2; y=x; what is y value. NOTE:EXPLANATION IS COMPALSARY with binary bits
HOW TO ANSWER IF ASKED " WHAT KIND OF A PERSON ARE YOU?" I NEED AN ANSWER THAT IMPRESS THE INTERVIEWER
#include<stdio.h> void main() { int a=5,b=6,c; int x=(a<b)+7; int y=(x==7)*9; int z=(c=x+y)*2; printf("%h %h %h",x,y,z); } What is the output? Explain it.
can we declare a function inside the structure? ex: struct book { int pages; float price; int library(int,float); }b; is the above declaration correct? as it has function declaration?