#include " stdio.h "
#include " conio.h "
#include " math.h "
void main()
{
float a,b,c,root1,root2;
clrscr();
printf("\n Enter values of a,b,c for finding roots of a quadratic eq:\n");
scanf("%f%f%f",&a,&b,&c);
/*checking condition*/
if( b*b > 4*a*c )
{
root1=-b+sqrt(b*b-4*a*c)/2*a;
root2=-b-sqrt(b*b-4*a*c)/2*a;
printf("\n*****ROOTS ARE*****\n");
printf("\n root1=%f\n root2=%f",root1,root2);
}
else
printf("\n Imaginary Roots.");
getch();
}
congratulations to the toppers
B. Raji Murthy -881 marks
B. Bharat Kumar -837 marks
Ch. Sailaja -820 marks
J. Siva Krishna -815 marks
K. Vijaya Swathi -807 marks
P. Santhosh Kumar -855 marks
P. Swathi Priya -804 marks
P. Sagar -816 marks
T. Lakshminaga Rohita -840 marks
U. Bharat Kumar -850 marks
B. Bharat Kumar -837 marks
Ch. Sailaja -820 marks
J. Siva Krishna -815 marks
K. Vijaya Swathi -807 marks
P. Santhosh Kumar -855 marks
P. Swathi Priya -804 marks
P. Sagar -816 marks
T. Lakshminaga Rohita -840 marks
U. Bharat Kumar -850 marks
Quick Links
- lab programs (67)
- files (13)
- story (12)
- viva questions for Lab (9)
- interview (4)
- movie making software (4)
- appliedphysics (3)
- cds syllabus (3)
- ADROIT (2)
- CDS LAB EXAM (2)
- English (2)
- VNRVJIET (2)
- class (2)
- edc (2)
- mm (2)
- quotes (2)
- strings (2)
- teacher (2)
- CDS MID 2 model paper (1)
- CDS papers (1)
- Vighney Reddy (1)
- absolutely ridiculous (1)
- academic calender (1)
- ansic ebook (1)
- barack obama (1)
- cds mid 3 model papers (1)
- eamcet-2009 (1)
- edp (1)
- happy new year (1)
- iteration (1)
- java e book (1)
- jntuprograms (1)
- maths (1)
- na (1)
- placement (1)
- republicday (1)
- structures (1)
- timetables (1)
- ఆఫీసు 2003 (1)
- హలో (1)
Saturday, November 7, 2009
c program for finding given number is arm strong or not with out using loops
#include " stdio.h "
#include " conio.h "
void main()
{
int a=371,b,c,arm=0,num;
num=a;
clrscr();
b=a%10;
arm=arm+b*b*b;
c=a/10;
b=c%10;
arm=arm+b*b*b;
c=c/10;
b=c%10;
arm=arm+b*b*b;
if ( num == arm )
printf("\n%d is arm strong number",num);
else
printf("\n%d is not arm strong number",num);
getch();
}
#include " conio.h "
void main()
{
int a=371,b,c,arm=0,num;
num=a;
clrscr();
b=a%10;
arm=arm+b*b*b;
c=a/10;
b=c%10;
arm=arm+b*b*b;
c=c/10;
b=c%10;
arm=arm+b*b*b;
if ( num == arm )
printf("\n%d is arm strong number",num);
else
printf("\n%d is not arm strong number",num);
getch();
}
Labels:
lab programs
c program for finding greatest among three numbers using if else statement
#include" stdio.h "
void main()
{
int a=1,b=11,c=0;
clrscr();
if ( a > b && a > c )
{
printf("\n a is greater");
}
else
if ( b > c )
{
printf("\n b is greater");
}
else
{
printf("c is greater");
}
getch();
}
void main()
{
int a=1,b=11,c=0;
clrscr();
if ( a > b && a > c )
{
printf("\n a is greater");
}
else
if ( b > c )
{
printf("\n b is greater");
}
else
{
printf("c is greater");
}
getch();
}
Labels:
lab programs
C program for finding greatest among 3 numbers using condtional operator(ternary operator)
#include
void main()
{
int a=1,b=11,c=13;
clrscr();
(a>b&&a>c)?printf("\n a is greater"):(b>c)?printf("\n b is greater"):printf("c is greater");
getch();
}
void main()
{
int a=1,b=11,c=13;
clrscr();
(a>b&&a>c)?printf("\n a is greater"):(b>c)?printf("\n b is greater"):printf("c is greater");
getch();
}
Labels:
lab programs
c program for special operators:sizeof
#include " stdio.h "
void main()
{
int a,b,c;
clrscr();
a=sizeof(int);
b=sizeof(float);
c=sizeof(char);
printf("size of int is %d",a);
printf("\n size of float is %d",b);
printf("\n size of char is %d",c);
getch();
}
void main()
{
int a,b,c;
clrscr();
a=sizeof(int);
b=sizeof(float);
c=sizeof(char);
printf("size of int is %d",a);
printf("\n size of float is %d",b);
printf("\n size of char is %d",c);
getch();
}
Labels:
lab programs
C program for Bit wise Operators:bitwise AND ,bitwise OR, bitwise EX-OR
#include " stdio.h "
void main()
{
int a=6,b=4;
clrscr();
printf("bitwise and is %d",a&b);
printf("\n bitwise or is %d",a|b);
printf("\n bitwise exor %d",a^b);
getch();
}
void main()
{
int a=6,b=4;
clrscr();
printf("bitwise and is %d",a&b);
printf("\n bitwise or is %d",a|b);
printf("\n bitwise exor %d",a^b);
getch();
}
Labels:
lab programs
c program for conversion of numbers from decimal to octal and hexa decimal
#include " stdio.h "
void main()
{
int a=10;
clrscr();
printf(" \n the value of c in decimal \t %d",a);
printf("\n the value of c in octal\t %o",a );
printf("\n the value of c in hexa decimal %x",a);
getch();
}
void main()
{
int a=10;
clrscr();
printf(" \n the value of c in decimal \t %d",a);
printf("\n the value of c in octal\t %o",a );
printf("\n the value of c in hexa decimal %x",a);
getch();
}
Labels:
lab programs
Subscribe to:
Posts (Atom)

