N

@nileshww

printing ascii values using while loop

C++
1 month ago
#include <iostream> using namespace std; int main() { char ch = 'A'; int i; i=1; while (ch<= 'Z'){

printing ascii values using while loop

C++
1 month ago
#include <iostream> using namespace std; int main() { char ch = 'A'; // to initiallise the loop while (ch<= 'Z'){ // loop ending cout<<ch<<" "<<(int)ch<<endl; // printing ascii values using typca

factorial printing using for loop

C++
1 month ago
#include <iostream> using namespace std; int main() { int n; cout<<" enter a number : "; cin>>n; int product; product = 1;

printing numbers in reverse

C++
1 month ago
#include <iostream> int main() { int n; std::cout<<" enter a number : "<<std::endl; std::cin>>n; int x;

using loops and storing numbers

C++
1 month ago
#include <iostream> using namespace std; int main() { int n; cout<<" enter a number : "<<endl; cin>>n; // input int x; x = 0;

multiple of the entered numbers using while loop and integers storing

C++
1 month ago
#include <iostream> using namespace std; int main() { int n; cout<<" enter a number : "<<endl; cin>>n; int sum; sum = 1; while(n>0){

sum of the entered numbers using while loop

C++
1 month ago
#include <iostream> using namespace std; int main() { int n; cout<<" enter a number :"<<endl; cin>>n; int sum; sum = 0;

sum of the entered numbers using while loop

C++
1 month ago
#include <iostream> using namespace std; int main() { int n; cout<<" enter a number :"<<endl; cin>>n; int sum; sum = 0;

while loop

C++
1 month ago
#include <iostream> using namespace std; int main() { int i; i = 1; while (i<=10) { cout<<i<<endl; i++;

do while loop

C++
1 month ago
#include <iostream> using namespace std; int main() { int n; cin>>n; int i =1; do { cout<<i<<endl; i++; }

do while loop

C++
1 month ago
#include <iostream> using namespace std; int main() { int i =1; do { cout<<i<<endl; i++; } while (i<=10);

printing odd number using continue statements

C++
1 month ago
#include <iostream> using namespace std; int main() { int n; cin>>n; int i; for (i=1 ; i<=n; i++){ if(i%2==0 ) continue; // continue is used to skip the round given in the if statement

prime composite number using boolen algebra

C++
1 month ago
#include <iostream> using namespace std; int main() { int n; cout << "Enter a number: "; cin >> n; bool flag = true; // true means prime for ( int i = 2; i<=n/2; i++){ flag = false ; // false means composite

finding highest divisor by using break statement

C++
1 month ago
#include <iostream> using namespace std; int main() { int n; cout << "Enter a number: "; cin >> n; for (int i = n/2 ; i>=1 ; i--) { if (n%i==0); {

efficient code for highest factor by storing the integer

C++
1 month ago
#include <iostream> using namespace std; int main() { int n; cout<<"enter a number: "; cin>>n; cout<<endl; int i; int f;

factors of a number

C++
1 month ago
#include <iostream> using namespace std; int main() { int n; cout<<"enter a number: "; cin>>n; cout<<endl; int i; for (i=1 ; i<n ; i++){

full functional gp

C++
1 month ago
#include <iostream> using namespace std; int main() { int x; int n; cout<<"enter 1st number "<<endl; cin>>n; //number of elements int i; cout<<"enter 2nd number "<<endl;

gp

C++
1 month ago
#include <iostream> using namespace std; int main() { int n; cout<<"enter a number"<<endl; cin>>n; int x; int a; a = 4; //initiallization of gp

percentage calculator

C++
1 month ago
#include <iostream> using namespace std; int main() { float x; cout<<"enter obtained marks"<<endl; cin>>x; float y; cout<<" enter total number "<<endl; cin>>y;

AP

C++
1 month ago
#include <iostream> using namespace std; int main() { int i; int n; cin>>n; int x=4; //starting