S

@Shobh89

Sum of even numbers from 1 to n

C++
1 year ago
#include <iostream> using namespace std; int main() { int n=190; int evenSum=0; for(int i=1;i<=n;i++){ if(i%2 ==0){ evenSum+=i;

Sum of odd Numbers from 1 to N

C++
1 year ago
#include <iostream> using namespace std; int main() { int n=190; int oddSum=0; for(int i=1;i<=n;i++){ if(i%2 !=0){ oddSum+=i;

sum of numbers from 1 to n

C++
1 year ago
#include <iostream> using namespace std; int main() { int n=50; int sum=0; for(int i=1;i<=n;i++){ //1+2+3+4+5=15 sum+=i; if(i==5){

Print numbers from 1 to 10

C++
1 year ago
#include <iostream> using namespace std; int main() { int count=1; while(count <= 10){ cout << count <<" "; count++; }

C Program to Display Prime Numbers Between Intervals

C
1 year ago
//C program to display prime //numbers between intervals #include <stdio.h> //Driver Code int main() { //Declare the variables int a,b,i,j,flag;

C Program to Find Sum of Natural Numbers using Recursion

C
1 year ago
//C program to find the sum of n //natural numbers using recursion #include <stdio.h> //Returns the sum of first n //natural numbers int recSum(int n) { //Base condition if(n<=1)

Find character lowercase or upper case

C++
1 year ago
#include <iostream> using namespace std; int main() { char ch; cout<<"enter char: "; cin>>ch; if(ch>=65 && ch<=90){ cout<<"uppercase\n";

C++ Program to Implement a Simple Calculator

C++
1 year ago
//C++ program to create calculator using //switch statement #include <iostream> using namespace std; //Driver Code int main() { char op; float num1,num2;

Sum of two numbers

C++
1 year ago
#include <iostream> using namespace std; int main() { int a,b; cout << "enter a : "; cin >>a; cout<<"enter b : "; cin >>b;

Base program

C++
1 year ago
#include <iostream> using namespace std; int main() { cout<<"Shobhit \n Singh"; return 0; }

C Program to Display Armstrong Number Between Two Intervals

C
1 year ago
#include <stdio.h> //Fuction to count the number of digits in a number int countDigits(int num){ int count=0; while (num !=0) { num /=10; ++count; } return count;

C Program to Print Armstrong Numbers Between 1 to 1000

C
1 year ago
// C Program to Display Armstrong // numbers between 1 to 1000 #include <math.h> #include <stdio.h> int main() { int i, sum, num, count = 0; printf( "All Armstrong number between 1 and 1000 are:\n");

Program to display alphabets using ASCII values

C
1 year ago
//C Program to display alphabets using ASCII values #include <stdio.h> int main() { int i; printf("Alphabets from(A-Z) are:\n"); //ASCII value of A=65 and Z=90 for(i=65;i<=90;i++){

C Program to Calculate Sum of Natural Numbers

C
1 year ago
//C program to demonstrate //Sum of Natural Numbers //using while loop #include <stdio.h> int main() { int i,s=0; int n=10; i=1;

C Program to Check Vowel or Consonant

C
1 year ago
//C program to check if a character //is a consonant or a vowel #include <stdio.h> //Driver Code int main() { char ch='A'; //Checking if the character ch

C Program to check whether the given number is Even or Odd

C
1 year ago
//C Program to Check Even or Odd Using Modulo Operator #include <stdio.h> void checkOddEven(int N){ //Find the remainder int r=N%2; //Condition for even if(r==0){

C Program to check if a number is positive, negative or zero using simple conditional checks

C
1 year ago
// C Program to check if a number is positive, negative, // or zero using simple conditional checks #include <stdio.h> void checkNum(int N){ //Check if the number is zero if(N==0){ printf("Zero\n"); }

Program to Print Your Own Name Using printf

C
1 year ago
//C program to Print Your Own Name using printf #include <stdio.h> int main() { //Printing your Name "Shobhit" on the output screen printf("Shobhit"); return 0; }

C program to read integer values in C

C
1 year ago
//C program to take an integer //as input and print it #include <stdio.h> //Driver Code int main() { //Declare the values int num;

C program to print the integer value

C
1 year ago
//C Program to Print //Integer value #include <stdio.h> //Driver Code int main() { //Declaring integer int x=5;