Still not sure what that means!
Well, this was an assignment problem and I blew my brains out pondering over this thing.
Please explain how I don't have control when the assignment happens....
Type: Posts; User: duffmckagan
Still not sure what that means!
Well, this was an assignment problem and I blew my brains out pondering over this thing.
Please explain how I don't have control when the assignment happens....
#include<stdio.h>
main()
{
int k=35;
printf ("%d %d %d", k==35, k=50, k>25);
}
Thanks some awesome information...
Thanks to all of you who replied here. :)
Msvc 6
@Salem
Thanks for pointing it out.
I had read somewhere that %lf is the format specifier for double!
Now I verified whether that was correct.
I understand now that the format specifier for...
I am learning and haven't yet dealt with arrays..so I have to make the program without arrays for the time being.
@ssharish2005
Thanks for pointing it out. (Logic is incorrect)
I think I...
Okay..so do you mean that changing it to double will help?
Also give some more inputs on using the sqrt function.
Here's a simple program that is to be used for calculating Sum, Average and Standard Deviation.
But it doesn't work. There's a problem with the sqrt function. I hear it returns a double value....
[/quote]
Write a general-purpose function to convert any given year into its roman equivalent.
The following table shows the roman equivalents of decimal numbers:
Decimal:.........Roman...
/*
Write a general-purpose function to convert any given year into its roman equivalent.
The following table shows the roman equivalents of decimal numbers:
Decimal:.........Roman...
Hehe..that was a silly mistake!!
I don't know how I did not notice that! :P
The following program gives the wrong output.
#include<stdio.h>
main()
{
int i, f;
int factorial();
Here's something that worked..
Idea based on that of fgw_three
for (number=2;number<=300;number++)
{
for (div=2; div<number; div++)
@fgw_three
Your program doesn't display the number 3...
I guess if(i==number) is mandatory then..
I have tried to do the same thing man...
for (number=1; number<=300; number++)
{
for (i=2; i<=number; i++)
{
if (i==number)
Okay..this is my new program..as lousy as it is..but it works!!!
#include<stdio.h>
main()
{
int number, i;
I at least took care of the duplicates..but there's one more problem!
Every number divisible by 5 is also there in the list!
Also, how do I take care of the number 2?
It is also not there on...
Actually I was trying to figure out the logic...
How do we make the computer win?
How do we know what move to make..how many matchsticks the computer should pick up..in case the user enters n...
The program is incomplete man..
I was just trying to figure it out..and then I posted it here...
I will edit that part though..
Thanks for bringing me back on track..got it now :)
Done a few changes...with the factorial thing...
result=0;
for (num=1; num<=7; num++)
{
#include<stdio.h>
main()
{
int number, i;
for (number=2;number<=300;number++)
{
for (i=2; i < number ; i++)
{
if (number%i==0)
Can anybody gimme an idea as to how this can be done..?
Write a program for a matchstick game being played between the computer and a user.
Your program should ensure that the computer always...
/*
Write a program to add first seven terms of the following series using a for loop:
(1/1!) + (2/2!) + (3/3!) + .....
*/
#include<stdio.h>
But still...
number%10 --- should extract the last number
and
number%100 -- should have extracted the first number (of a three digit number), isn't it?
Worked :)
I changed the digit extraction scheme to this:
digit1 = number - ((number / 10) * 10);
digit2 = (number / 10) - ((number / 100) * 10);
digit3 = (number / 100) - ((number /...