Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

What is wrong with this question

+1 vote
asked Oct 13, 2018 by Mohammed
retagged Oct 14, 2018
#include <stdio.h>
int main(void){
    int n=0, row=0, column=0;
/*Add something to display on the screen*/
printf("Give a positive integer n, where n is between 2 and 9:\n");
scanf("%i", &n);
    while(column<=row){
        printf("*");
        printf("\n");
        column=2;}
        row=9;
}

2 Answers

0 votes
answered Oct 13, 2018 by Laurentiu Stefan (440 points)
 
Best answer
Your code will output *

After you assign 2 to column the loop ends because 2 <= 0 is FALSE and then row gets assigned the value of 9.

Not sure what you are trying to do.
commented Oct 14, 2018 by Mohammed
I am trying to form a right angled triangle using stars, how can i go about that?
0 votes
answered Oct 20, 2018 by anonymous

this is wrong "scanf("%i", &n);"

true is "scanf("%d", &n);"

Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...