24.12.19

To print all the even numbers (using for )b/w 1 to 10 program inc

#include<stdio.h>

void main()
{
int i;

for(i=0;i<=10;i++)
{

if(i%2==0)

printf("%d\t",i);

 }
}

OUTPUT

2 4 6  8 

No comments:

Post a Comment

JAVA program pattern 2

import java.util.Scanner; public class pattern3 { public static void main(String args[]) { int i,j; Scanner sc=new Scanner(System.in); Syste...