0% found this document useful (0 votes)
28 views2 pages

Junior C Prog PDF

This C code document contains 3 short programs: 1) A program that adds two integers and prints the sum, 2) A program that checks if a given integer is even or odd, and 3) A program that prints the multiplication table of a given integer up to 10.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views2 pages

Junior C Prog PDF

This C code document contains 3 short programs: 1) A program that adds two integers and prints the sum, 2) A program that checks if a given integer is even or odd, and 3) A program that prints the multiplication table of a given integer up to 10.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

/* ADDITION OF TWO NUMBERS*/

#include<stdio.h>

int main()
{
int a, b, c;

printf("Enter two numbers to add\n");


scanf("%d%d", &a, &b);

c = a + b;

printf("Sum of the numbers = %d\n", c);

return 0;
}

/*FIND EVEN OR ODD*/

#include<stdio.h>
int main()
{
int number;

printf("Enter an integer: ");


scanf("%d", &number);
if(number % 2 == 0)
printf("%d is even.", number);
else
printf("%d is odd.", number);

return 0;
}

/*TABLE OF FIVE */

#include <stdio.h>
int main()
{
int n, i;

printf("Enter an integer: ");


scanf("%d",&n);

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


{
printf("%d * %d = %d \n", n, i, n*i);
}

return 0;
}

You might also like