can please someone teach me how to create this program using
while statement.. this is the output should look like
0
2
4
6
8
10
-thanks.. :) need it asap...
Answer Posted / manish soni bca 3rd year jaipu
#include<stdio.h>
#include<conio.h>
void main()
{
int cnt,term;
cnt=0;
while(cnt<6)
{
cnt+=1;
term=(cnt*2-1)^1;
printf("%d\n",term);
}
getch();
}
manish soni tagore biotech collage jaipur
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is structure pointer in c?
What type is sizeof?
If one class contains another class as a member, in what order are the two class constructors called a) Constructor for the member class is called first b) Constructor for the member class is called second c) Only one of the constructors is called d) all of the above
Here is a good puzzle: how do you write a program which produces its own source code as output?
main() { inta=10,b=20; a>=5?b=100:b=200; printf("%d ",b); }
What is the use of sizeof?
Is it better to use a macro or a function?
Write a program that takes a 5 digit number and calculates 2 power that number and prints it(should not use big integers and exponential functions)
What are c header files?
How main function is called in c?
Can you define which header file to include at compile time?
Explain what is the benefit of using #define to declare a constant?
Explain output of printf("Hello World"-'A'+'B'); ?
How can I ensure that integer arithmetic doesnt overflow?
What are enumerated types?