1. Write a c program to reverse any number.
2. Write a c program to find out sum of digit of given number.
2. Write a c program to find out sum of digit of given number.
10. Write a c program to find out NCR factor of given number.
11. How to convert string to int without using library functions in c
12. Program in c to print 1 to 100 without using loop
13. C program for swapping of two numbers
14. Program to find largest of n numbers in c
15. Split number into digits in c programming
16. C program to count number of digits in a number
11. How to convert string to int without using library functions in c
12. Program in c to print 1 to 100 without using loop
13. C program for swapping of two numbers
14. Program to find largest of n numbers in c
15. Split number into digits in c programming
16. C program to count number of digits in a number
29 comments:
Excellent piece of code :) Thanks a lot
Thanks for solving many problem related to any programming problem issue....
#include
int main(){
int a,b,c,big;
printf("\nEnter 3 numbers:");
scanf("%d %d %d",&a,&b,&c);
big=(a>b?(a>c?a:b):(b>c?b:c));
printf("\nThe biggest number is:%d",big);
return 0;
}
wanaa any help regarding C..jst mail me at
gotopunit@gmail.com
any idea how to do this:
Write a program that requests 5 numbers from the user then finds the minimum number among all the number.
Sample Input:
Enter a number 1: 3
Enter a number 2: 0
Enter a number 3: -4
Enter a number 4: 9
Enter a number 5: 0
Sample Output:
Numbers you had input are: 3 0 -4 9 0
Minimum number is: -4
#include
#include
#define size 5
void main()
{
int no[size],min=0,max=0,i;
clrscr();
for(i=0;ino[i])
{
min=no[i];
}
if(max<no[i])
{
max=no[i];
}
}
printf("\n Minimum No is : - %d",min);
printf("\n Maximum No is : - %d",max);
getch();
}
Note : you can find minimum and maximum number from any number of input number.
void main()
{
int no[5],i,min,max;
clrscr();
for(i=0;i<5;i++)
{
printf("\n Enter %d No : - ",i+1);
scanf("%d",&no[i]);
}
min=max=no[i];
for(i=0;i<5;i++)
{
if(min>no[i])
min=no[i];
if(max<no[i])
max=no[i]
}
printf("\n Minimum No is : - %d",min);
printf("\n Maximum No is : - %d",max);
getch();
}
#include
#include
int main()
{
int a,b,c;
printf("Enter value of a,b,c\n");
scanf("%d%d%d",&a,&b,&c);
if(a>b)
{
if(a>c)
printf("Largest no is\t%d",a);
else
printf("Largest no is\t%d",c);
}
else
{
if(b>c)
printf("Largest no is\t%d",b);
else
printf("Largest no is\t%d",c);
}
getch();
}
I wanna Calculate Biggest number among 5 integers plz help me
pls explain me the 6th line of the above prog...
6th line: a>b&&a>c?a:b>c?b:c
It is equivalent to:
if(a > b && a>c)
return a
else if (b>c)
return b
else
return c
nice explanation
thanks for the help and explanation
Please show me a program which Takes 10 integers as input and prints the largest one.
Write a c program that allows the user to input an integer value n, followed by n floating point numbers and display the sum of these n values as well as the largest and smallest among the values.
then how to find the smallest
biggest of 3 nos program is correct.. got correct output ........ but we enter 8-3-9 getting "3 is a largest no" (or) if we enter this no 6-5-9 also getting "5 is largest no" ......... how is possible pls give a solution for me
...............by raghu
Your solution is wrong the correct expression of line no. 6 will be :
big = (a>b)?(a>c?a:c):(b>c?b:c);
This code is wrong Try new code .
#include
#include
#define size 5
void main()
{
int no[size],min=0,max=0,i;
clrscr();
for(i=0;ino[i])
{
min=no[i];
}
if(max<no[i])
{
max=no[i];
}
}
printf("\n Minimum No is : - %d",min);
printf("\n Maximum No is : - %d",max);
getch();
}
its a very good sir . . .
write a prg to input 3 no and print the largest no using conditional statement
plargest of 3 numbers using conditional statements...,
largest of 3 numbers using conditional statement
#include
void main()
{
int a,b,c;
printf("enter values of a,b and c");
scanf(" %d %d %d",&a,&b,&c);
if(a>b && a>c)
{ printf(" %d is greater",a); }
else if(b>c)
{ printf(" %d is greater",b); }
else
printf(" %d is greater",c);
}
program to display greatest of four numbers
// largest of 5 no.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include
#include
int _tmain(int argc, _TCHAR* argv[])
{
int a[5],i,n,small,large;
printf("enter array size\n");
scanf("%d",&n);
for(i=0;ia[i])
{
small=a[i];
}
if(large<a[i])
large=a[i];
}
printf("small no=%d",small);
printf("large=%d",large);
getch();
return 0;
}
Please I need a code that determines if two is less than five using a ternary operator
#include
int main(){
int a,b,c;
printf("enter the value of a b c:");
scanf("%d %d %d",&a,&b,&c);
if (a>b && a>c)
{
printf (“The largest number is a:%d”,a);
}
else if (b>a && b>c)
{
printf (“The largest number is b:%d”,b);
}
else
{
printf (“The largest number is c:%d”,c);
}
return 0;
}
Excellent post!keep update more information like this in future.
Python Training in Chennai
Python Training in T.Nagar
JAVA Training in Chennai
Big data training in chennai
Selenium Training in Chennai
Python Training in Annanagar
int a,b,c,temp,big;
temp=a>b?a:b;
big=temp>c?temp:c;
printf("%d",big);
Post a Comment