Program in c language using if-else condition.

1-write a program in c language to find greater in between two number using if-else condition.


if else program , c language program, c program, java program, python program, Programming 5 axis cnc, java web services rest, java spring tutorial, java rest api,java point, java virtual machine, java executor framework, java for windows 7, restful  web services java, java web services soap, java 8 download, programming game ai by example, programming questions in java, programming quotes, programming for problem solving, programming with mosh, programming near me, programming in visual basic, programming python pdf, programming r, programming aptitude test, c program to find sum of n numbers using for loop, c program to find sum of n numbers using function, sum of numbers from 1 to 100 in c, c program for sum of two numbers, c program to find multiples of a number, c program to find sum of n numbers using array, c program to find sum of 10 numbers using function, how to find multiples of a number in c++,
if-else program

#include < stdio.h>

#include< conio.h>

void main()

{

Int a=4,b=9;

clrscr();

If (a>b)

{

Printf(“a is grater than b”);

}

else

Printf(“b is grater than a”);

getch();

}

Output:- b is grater than a

Write a C-language program for Addition,Substraction,Multiplication and Division.

2- write a c-language program using if- else condition to find your age is eligble for voting or not.


#include < stdio.h>

#include< conio.h>

void main()

{

Int age;

clrscr();

Printf(“please enter your age:”);

Scanf(“%d”,&age);

If (age>=18)

{

Printf (“you are eligible for voting”);

}

else

{

Printf(“you are not eligible for voting”);

}

getch();

}

Output:-

please enter your age: 21

you are eligible for voting


3-Write a program in C- language to find odd and even number using if-else condition.


#include<stdio.h>

#include<conio.h>

int main()

{

int number;

clrscr();

printf(“Enter a number:-”);

scanf(“%d”,&number);

if (number%2 == 0)

{

printf(“%d is an even Number”, number);

}

else

{

printf (“%d is an odd number”, number);

}

getch();

}

Output:- Enter a number:- 4

               4 is an even Number


4-Write a C- language program to relate two integers using =, > or < symbol.

#include<stdio.h>

#include<conio.h>

Void main()

{

Int num1, num2;

clrscr();

printf(“Enter Two Numbers:-“);

scanf(“%d %d”,&num1,&num2);

if(num1= = num2)

{

Printf( “Result: %d= %d”,num1,num2);

}

else if (num1> num2)

{

Printf( “Result: %d> %d”,num1,num2);

}

else

{

Printf( “Result: %d< %d”,num1,num2);

}

getch();

}

Output:- Enter Two Numbers:- 12 25

Result: 12 < 25

c program to arrange 3- numbers in ascending order without using array.


5-write a program in c++ to find greater in between two number using if-else condition.


#include < iostream.h >

Using namespace std;

void main()

{

Int n=4,m=9;

clrscr();

If (n>m)

{

Printf(“n is grater than m”);

}

else

Printf(“n is grater than m”);

return 0;

}

Output:- m is grater than n

Write a C- program to compute the circumference of a circle and area of circle.

Post a Comment

0 Comments