Pages

Friday, March 21, 2025

inputs in C++? How does it work

 


#include<iostream>
#include<iomanip>
using namespace std;

int main() {
    int age; // garbage value
    cout<<"Enter your age: ";
    cin>>age;  // cin waits for a value to be entered

    cout<<"your age is "<<age<<endl;
    return 0;

}

No comments:

Post a Comment

3917. Count Indices With Opposite Parity (Brute Force) O(n2) + Optimized Solution O(n) + tips LEETCODE WEEKLY 500

  class Solution {     public int [] countOppositeParity ( int [] nums ) {          // approach 1 - checks every pair         int n = n...