0% found this document useful (0 votes)
18 views

C-Programming - I Laboratory Practice Programs: - Rutvik Sheth

The document discusses writing C programming lab programs including finding the smallest of three integers, determining if a number is odd or even, checking if a year is a leap year, and calculating an expression. It also provides the code and output for a C program example.

Uploaded by

Rutvik Sheth
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

C-Programming - I Laboratory Practice Programs: - Rutvik Sheth

The document discusses writing C programming lab programs including finding the smallest of three integers, determining if a number is odd or even, checking if a year is a leap year, and calculating an expression. It also provides the code and output for a C program example.

Uploaded by

Rutvik Sheth
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 4

C-Programming – I

Laboratory practice programs

-Rutvik Sheth
M.Tech (Structures)
D.D.U, Nadiad
WRITE THE FOLLOWING PROGRAMS IN YOUR
NOTEBOOK AND THEN EXECUTE THEM:
 Write a program to find out the smallest integer out of given
three integers using ternary operator.
 Write a program to find odd/even number.
 Write a program to find whether a given year is a leap year.
 Write a program to obtain the following result:
(x*y+ (x+y)^2+ (x-y)*y)^0.4

2
Rutvik Sheth
WRITE OUTPUT FOR THE FOLLOWING
PROGRAM:
# include <stdio.h>
# include <conio.h>
void main()
{
int a, b, c, d;
a = 15;
b = 10;
c = ++a - b;
printf("a = %d b = %d c = %d\n",a, b, c);
d = b++ +a;
printf("a = %d b = %d d = %d\n",a, b, d);
printf("a/b = %d\n", a/b);
printf("a%%b = %d\n", a%b);
printf("a *= b = %d\n", a*=b);
printf("%d\n", (c>d) ? 1 : 0);
3
printf("%d\n", (c<d) ? 1 : 0); Rutvik Sheth
Thank you

4
Application of Neural Network for Design of RCC Column

You might also like