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

C-Lab_Task5

The document outlines laboratory practices for C programming, including specific exercises such as finding the smallest integer using a ternary operator, determining odd/even numbers, and checking for leap years. It also includes a sample program with output instructions and various operations on integers. The author is Rutvik Sheth, an M.Tech student at D.D.U, Nadiad.

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)
2 views

C-Lab_Task5

The document outlines laboratory practices for C programming, including specific exercises such as finding the smallest integer using a ternary operator, determining odd/even numbers, and checking for leap years. It also includes a sample program with output instructions and various operations on integers. The author is Rutvik Sheth, an M.Tech student at D.D.U, Nadiad.

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