Write A Program to print 1 to 10 even numbers using goto

#include<stdio.h> #include<conio.h> void main ( ) { int i = 1; top  : if ( i < =10) {   if (i%2 = = 0) ...

#include<stdio.h>
#include<conio.h>
void main ( )
{
int i = 1;
top  :
if ( i < =10)
{
  if (i%2 = = 0)
  {
   printf (“\n%d", i);
  }
  i = i +1;
  goto top;
}
getch ( );
}

Out Put:

2
4
6
8
10

Related

PROGRAM FOR CALCULATING SIMPLE INTREST

#include<stdio.h> #include<conio.h> void main() {   int p,t,r;   float si;   clrscr();   printf("enter p,t,r values");   scanf("%d%d%d",&p,&t,&am...

Program for calculating Sum of Digits of a given Number

#include<stdio.h> #include<conio.h> main (  ) { int n, s,n,r ; 0; printf (“enter a number”); scanf (“%d”, &n); while (n! = 0) { r = n% 10; s = r + s; n = n/10; prin...

Write A Program for sorting of n numbers (bubble sort)

#include<stdio.h> #include<conio.h> void main ( ) { int x [100],n; i, j, temp; printf (“enter size of the array”); scanf ("%d”, & n); printf (“\n enter elements into an arra...

Post a Comment

emo-but-icon
:noprob:
:smile:
:shy:
:trope:
:sneered:
:happy:
:escort:
:rapt:
:love:
:heart:
:angry:
:hate:
:sad:
:sigh:
:disappointed:
:cry:
:fear:
:surprise:
:unbelieve:
:shit:
:like:
:dislike:
:clap:
:cuff:
:fist:
:ok:
:file:
:link:
:place:
:contact:

item