answersLogoWhite

0


Best Answer

leap yr = ((y%100!=0 && yr %400==0)?1:(yr%4==0)?1:0;

leap yr =1;

printf ("leap yr");

else

printf ("not leap yr");

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a program to check whether a given year is leap year or not using ternary operator?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How can you download c compiler?

write a c program to fine largest/smallest of 3no (using ?:ternary operator/conditional operator)


How do you write a algorithm for finding maximum of 2 numbers in c?

You can use the ternary operator, in an expression such as: result = a > b ? a : b; This is equivalent to: if (a > b) result = a; else result = b;


Write a programme to find greater among two numbers in c plus plus?

You could use an if, but the ternary operator is especially compact for this purpose: result = a > b ? a : b;


Write a program By using if else statement to read a number and check whether it is positive or negative?

write a c++program by using if statement to read a number and check whether it is positive or negative


How do you write the formula for ternary ionic compounds?

π¬s9888hcof=GAy


How do you write a C program to check whether the number is odd or even Ps-using DEV complier?

To write a C program to determine if something is odd or even you need to be a programmer. To write a program in C is complicate and only done by programmers.


Write a c plus plus program to find the largest among three numbers using ternary operators?

R = (A > B && A > C) ? A : (B > C) ? B : C; // parentheses not necessary - for clarity only


Write a program in C for arithmetic operations between two integers your program should guide users with proper message or menu on the console?

Write a program in C for showing working of different logical operator in C.Your program should guide users with proper message/menu on the console. (5 Marks)


How do you write a program in visual foxpro?

Same with other Visual Basic program, programming in FoxPro will require you to have the right syntax.


Can you write a C program to check whether a string is an IP address or not?

Use the Exception class and type converters.


How do you write a c program to find biggest among two numbers using conditional operator?

int max (int a, int b) { return a>b?a:b; }


Write java program for addition of two objects?

May be link might help -> http://www.allinterview.com/viewpost/408298.html There it is implemented through...... Operator Overloading!