#include<stdio.h> int main() { int num; printf("Enter an integer: "); scanf("%d",&num); if ( num%2 == 0 ) printf("%d is an...
Continue reading...C PROGRAMS
Program in C to find prime numbers in a given range
#include <stdio.h> int main() { int num1, num2, flag_var, i, j; /* Ask user to input the from/to range *...
Continue reading...Program in C to check a number is palindrome or not
#include <stdio.h> int main() { int n, reversed = 0, remainder, original; printf("Enter an integer: "); scanf("%d", &n); original =...
Continue reading...Program in C to display Fibonacci series
#include<stdio.h> int main() { int count, first_term = 0, second_term = 1, next_term, i; //Ask user to input number of...
Continue reading...Program in C to find largest number using if statement
#include <stdio.h> int main() { double num1, num2, num3; printf("Enter first number: "); scanf("%lf", &num1); printf("Enter second number: "); scanf("%lf",...
Continue reading...Program in C to Print an Integer entered by the user
#include <stdio.h> int main() { int number; printf("Enter an integer: "); // reads the user input stores in ‘number’ scanf("%d",...
Continue reading...Program in C to check whether the given integer is positive or negative
#include <stdio.h> void main() { int num; printf("Enter a number: n"); scanf("%d", &num); if (num > 0) printf("%d is a...
Continue reading...Program in C to print English Alphabets
#include <stdio.h> int main() { for (char c= ‘A’; c <= ‘Z’; ++c) printf("%c ", c); return 0; } import...
Continue reading...Program in C to add two numbers Copy
#include <stdio.h> void main() { int num1, num2, sum; printf("Enter two integers: "); scanf("%d %d", &num1, &num2); // calculating sum...
Continue reading...Program in C to Write Hello world
#include <stdio.h> int main() { // printf() displays the string inside quotation printf("Hello,Learner!!"); return 0; } import java.util.*; public class...
Continue reading...