You are on page 1of 3

C PROGRAMMING

To print 1 to n even numbers

#include <stdio.h>
int main()
. {
int i,n;
print(“print all even
numbers”);
PYTHON PROGRAMMING
 To print largest of three numbers

 #input three integer numbers


 a=int(input(“Enter A: “))
 b=int(input(“Enter B: “))
 c=int(input(“Enter C: “))
 if a>b:
 if a>c:
 g=a
 else:
 g=c
 else:
 if b>c:
 g=b
 else:
 g=c
 print(“Greater = “,g);
 Scanf(“%d”, &n);
 Printf(“Even numbers from 1 to %d are: “);
 for(i=1:i<=n:i++)
 {
 if(i%2==0)
 {
 printf(“%d”,i);
 }
 }
 return 0;}

You might also like