#include<stdio.h>
main()
{
int i=0,j=0,n;
printf("Enter a number:");
scanf("%d",&n);
printf("The first %d odd numbers are:-\n");
for(i=0;i<=n;i++)
{
if(j%2!=0)
printf("%d\n"j);
j=j+1;
}
}
You can't display ALL odd numbers because your program will be running forever, counting towards infinity. A much more useful program would be to display all odd numbers between some numbers x and y:
void displayOdds(int x, int y)
{
// Ensure that x is an odd number
if(x % 2 == 0)
x++;
for(; x <=y; x+=2)
printf("%d\n", x);
}
int n, i;
printf ("Enter n: ");
scanf ("%d", &n);
for (i=1, i<=n, i+=2) printf ("%d\n", i);
To write a C++ program to display the student details using class and array of object.
you do this 10 print "0112358132134" use the whole of the thing
Write a program which takes the temperature in farhenheight.the program should display the farhenheight temperature as well as centigrade. C= (f-32)*5/9
A C++ program can be used to write C programs that will display 10 lines of biodata. Many types of C programming can be written with a C++ program.
dono
To write a C++ program to display the student details using class and array of object.
By learning how to program on C+.
you do this 10 print "0112358132134" use the whole of the thing
I know how to do this and you need to know how to do this. Why don't you do your best at writing this program and if it does not work then ask for help. You will not learn anything if I give you the answer.
Write a function that implements an algorithm that checks to see if a particular integer is prime (returning a boolean). Write a program that uses that function on each number from 1 to 100, and if true, displays that number.
write a program to display your name age class schoolname e-mail 2hobby based on choice
Faisal
#include <stdio.h> int main (void) { puts ("0123456789"); return 0; }
Write a program which takes the temperature in farhenheight.the program should display the farhenheight temperature as well as centigrade. C= (f-32)*5/9
A C++ program can be used to write C programs that will display 10 lines of biodata. Many types of C programming can be written with a C++ program.
dono
#include<stdio> #include<conio> class program { namespace display { console.println("write your text"); } } correct me if im wrong im a new programmer.