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.

closed To print natural numbers from 1 to 32767

–4 votes
asked Jul 2, 2018 by anonymous
closed Jun 14, 2020 by Admin
main()
{
int i=1;
while(i<=32767)
{
 printf("\n %d",i);
 i=i++;
}
}
closed with the note: Since it as been answered.

18 Answers

0 votes
answered Jul 14, 2018 by jagruthi
#include<stdio.h>

void main(){

int i;

for(i=1;i<=32767;i++)

{

printf("%d",i);

}

}
0 votes
answered Jul 15, 2018 by anonymous
#include <iostream>
int main()
{
    int i=1;
    while (i<=32767)
    {
        std::cout<<i<<std::endl;
        i++;
    }
    return 0;
}
0 votes
answered Jul 16, 2018 by anonymous
,#include<stdio.h>

void main()

{

int i=1;

for(i=1;i<=32767;i++)

{

   printf("%d",i);

}

}
0 votes
answered Jul 21, 2018 by Shankhadip Kundu (140 points)

main()
{
long i=1;
while(i<=32767)
{
 printf("\n %d",i);
 i++;
}
}

0 votes
answered Jul 24, 2018 by monika murali
#include<stdio.h>

int main()

{

int i;

for(i=1;i<=32767;i++)

{

printf("%d",i);

return(0);

}

}
0 votes
answered Jul 24, 2018 by anonymous
#include<iostream>

using namespace std;

int main(){

for(int a=1 ;a<=32767;a++){

cout<<a;

return 0;

}
0 votes
answered Jun 10, 2020 by mahesh (470 points)
#include<stdio.h>
main()
{
    int i=1;
    while(i<=32767)
    {
        printf("i=%d",i++);
    }
    
}
0 votes
answered Jun 13, 2020 by mahesh (470 points)
#include <stdio.h>
main()
{
    int i;
    for(i=1;i<=32767;i++)
    
    printf("%d\n",i);
   
}
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.
...