Computer Science, asked by Anonymous, 1 year ago

Write a program to:-

PRINT NATURAL NUMBER BETWEEN 15 AND 50.

PLEASE REPLY ME FAST.

Answers

Answered by ShivaniK123
0
Since you haven't specified the programming language , here's the answer :

In c language :
#include<stdio.h> 
int main()
{
   int i = 15;
printf("Natural numbers between 15 & 50 are : ");
   for ( i = 15 ; i <= 50 ; i++ )
{
      printf("%d", i);
   }
   return (0);
}

In java :
public class Printnumbers
{
public static void main(String[] args)
{
System.out.println("Natural numbers between 15 & 50 are : ");
for( int i = 15 ; i <= 50 ; i++ )
{ System.out.println(i);
}
}
}

in c++ :
#include<iostream.h>
#include<conio.h>
main()
{
clrscr();
cout<<"Natural numbers between 15 & 50 are :"<<endl;
for( int count=15 ; count<=50 ; count++ )
cout<<" "<<count;
getch();
return 0;
}

in c# :
using System;
public class Printnumbers
{ public static void Main()
{
Console.WriteLine("Natural numbers between 15 & 50 are : ");
for ( int i=15 ; i<=50 ; i++ )
{
Console.WriteLine(i);
}
}
}

Answered by Anonymous
0
Hope it helps u
Thanks
3:16
Attachments:
Similar questions