Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"cStandard": "c17",
"cppStandard": "c++17",
"intelliSenseMode": "windows-msvc-x64"
}
],
"version": 4
}
15 changes: 15 additions & 0 deletions question1.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//1. Print Hello world! in reverse
#include<bits/stdc++.h>
using namespace std;

int main(){
string str="Hello World";
for(int i=n-1;i>=0;i--){
cout<<str[i];

}
cout<<endl;
return 0;
}


17 changes: 17 additions & 0 deletions question2.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//2. Print 1 to 100 skipping every multiples of 5 and 2
#include<bits/stdc++.h>
using namespace std;

int main(){

for(int i=1;i<=100;i++){
if(i%2==0&&i%5==0){
continue;
}else{
cout<<i<<endl;
}

}
cout<<endl;
return 0;
}
28 changes: 28 additions & 0 deletions question3.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
//3.Check for n-digit arm-strong number

#include <iostream>
using namespace std;

int main() {
int num, originalNum, remainder, result = 0;
cout << "Enter a three-digit integer: ";
cin >> num;
originalNum = num;

while (originalNum != 0) {
// remainder contains the last digit
remainder = originalNum % 10;

result += remainder * remainder * remainder;

// removing last digit from the orignal number
originalNum /= 10;
}

if (result == num)
cout << num << " is an Armstrong number.";
else
cout << num << " is not an Armstrong number.";

return 0;
}
Empty file added question4.cpp
Empty file.