Header Ads Widget

Write a c program that print the first 10 odd number.

Write a c program that print first 10 odd numbers using loop

Given a number , write a program to find the factorial of a given numbers .

Sample output:

1 3 5 7 9 11 13 15 17 19 

 Write a c program to calculate the factorial of a number using loop

The objective of the code is to find the factorial of  number. Value of n is given by user .

 Code(C):-

#include<stdio.h>
int main()
{
int i;
printf("First 10 Odd numbers are \n");
for(i=1;i<=20;i++)
{
if(i%2!=0)
printf("%d ",i);
}
}

Output:-

First 10 Odd numbers are
1 3 5 7 9 11 13 15 17 19



Recommended Post :-

HCL Coding Questions:-

Capgemini Coding Questions:-

Companies interview:-

Full C course:-    

Key points:-

Cracking the coding interview:-

 Array and string:-

Tree and graph:-

Hackerearth Problems:-

Hackerrank Problems:-

Data structure:-

 MCQs:-