








Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!









Key Words of C
Memory
x = a + b ;
#include <iostream.h>
main ( )
{
int age1, age2, age3, age4, age5, age6, age7, age8, age9, age10 ; int TotalAge ; int AverageAge ;
cout << “ Please enter the age of student 1: “ ; cin >> age1 ;
cout << “ Please enter the age of student 2: “ ; cin >> age2 ; : : TotalAge = age1+ age2 + age3+ age4+ age5+age6+ age7+ age8+age9 + age10 ; AverageAge = TotalAge / 10 ;
cout<< “The average age of the class is :” << AverageAge ;
}
a*b%c +d
a(b%c) = ab%c
Interesting Problem
Given a four-digit integer,
separate and print the digits
on the screen
Code
#include <iostream.h>
main ( )
{
int number; int digit; cout << “Please enter a 4 digit integer : ”; cin >> number; digit = number %10; cout <<“The digit is: “ << digit << ‘\n’; // first digit; and then << ‘\n’ number = number / 10; digit = number % 10; cout <<“The digit is: “ << digit << ‘\n’; number = number / 10; digit = number % 10; cout <<“The digit is: “ << digit << ‘\n’; number = number / 10; digit = number % 10; cout <<“The digit is: “ << digit;
} Docsity.com