how can i make a program that counts a number multiple by two?
vic18
0
Newbie Poster
Recommended Answers
Jump to Postcreate a for loop and increment the loop counter by two -- inside he loop call printf() to display the value of the loop counter.
Or maybe I misunderstood the question.
get a number from the keyboard
multiply it by 2
call printf() to display the result
Jump to Post>>for(i=0;i<sizeof(num)/2;i++)
Wong. You fail the test. sizeof(int) may or may not be 2, depending on your compiler.
All 5 Replies
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
prvnkmr449
-8
Junior Poster
ananda2007
-3
Newbie Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
prvnkmr449
-8
Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.