Monday, 24 August 2015
Rupani Tejas: New Defination
Rupani Tejas: New Defination: Write a program to take 3 numbers a, r and n from user and print the arithmetic sequence like { a, ar, ar , ..., ar } sample input and outp...
New Definition
Write a program to take 3 numbers a, r and n from user and print the arithmetic sequence like { a, ar, ar , ..., ar } sample input and output statements are given below .
Enter a: 5
Enter r: 2
Enter n: 4
Substituting value of 'a', 'r', and 'n' in the sequence {a, ar }
= {5, 5* , 5*2 , 5*2 , 5*2 }
= {5, 10, 20, 40, 80}
Enter a: 5
Enter r: 2
Enter n: 4
Substituting value of 'a', 'r', and 'n' in the sequence {a, ar }
= {5, 5* , 5*2 , 5*2 , 5*2 }
= {5, 10, 20, 40, 80}
Saturday, 22 August 2015
C language program definition
Write a program to find smallest missing number of first array from value of second array......hello guys start coding and reply
Saturday, 8 August 2015
Welcome to C Language World!!!
Hello all,
You can ask any question related to C lanuage.
You can also ask for programming solution of C.Program for Pythagorean triple :
For example, 3, 5 and 4 form a Pythagorean triple, since 3*3 + 4*4 = 25 = 5*5
Solution:
#include
int main()
{
int a,b,c,no,flag=0;
scanf("%d%d%d",&a,&b,&c);
if(a>b && a>c)
{
if(b*b+c*c==a*a)
flag=1;
else
flag=0;
}
else if(b>a && b>c)
{
if(a*a+c*c==b*b)
flag=1;
else
flag=0;
}
else
{
if(a*a+b*b==c*c)
flag=1;
else
flag=0;
}
if(flag==1)
printf("yes");
else
printf("no");
}
Subscribe to:
Posts (Atom)