Wednesday, September 23, 2020
NPTEL PROGRAMMING IN C++ ASSIGNMENT WEEK 2 ANSWERS 2020(JUL-DEC)
Question 1:
Complex operator*(Complex &p1, Complex &p2) { // LINE-1
struct Complex p3 = { 0, 0 };
p3.x = (p1.x)*(p2.x) - (p1.y)*(p2.y); // LINE-2
p3.y = (p1.x)*(p2.y) + (p1.y)*(p2.x); // LINE-3
return p3;
}
Question 2:
#include <iostream>
#include <string>
using namespace std;
void print(string a, string b = "Anyone") { // LINE-1
Question 3:
#include <iostream>
using namespace std;
int Double(int a) { // LINE-1
return a*2; // LINE-2
}
Question 4:
int main() {
int *p;
int arr[10];
p = arr;// LINE-1
process(p);
return 0;
}
Monday, September 14, 2020
Programming in Java WEEK 1 NPTEL(JULY - DEC 2020) ASSIGNMNET SOL.
Question 1:
Question 2:
Question 3:
Question 4:
Question 5:
Programming in C++ WEEK 1 NPTEL(JULY-DEC 2020) ASSIGNMNET SOL.
Question 1 :
stack<char> s; // LINE-1
for (int i = 0; i < strlen(str); i++)
s.push(str[i]); // LINE-2
Question 2 :
bool StrCmp(string s1, string s2) {
if (s1.length()>s2.length() || s1.length()<s2.length()) // LINE-1
return 1; // LINE-2
else
return 0; // LINE-3
}
Question 3 :
typedef void (*Fun_Ptr)(int,int); // LINE-1
Fun_Ptr fp = &add; // LINE-2
Sunday, September 13, 2020
Introduction to Programming in C week 1 NPTEL(JULY - DEC 2020) assignmnet solution
Question 1 :
#include<stdio.h>
void main()
{
int arr[4];
for(int i=0; i<3; i++)
scanf("%d",&arr[i]); //To take input.
int sum = arr[0] + arr[1];
if(sum>arr[2]) //if statement to check wether third number is smaller than the sum of
printf("1"); //first two.
else
printf("0");
}
Question 2 :
#include<stdio.h>
void main()
{
int m,n;
scanf("%d",&m);
scanf("%d",&n);
int rem = m%n; //% is used to find the remainder.
if(rem==1)
printf("1");
else
printf("0");
}
Question 3:
#include<stdio.h>
void main()
{
float arr[4];
for(int i=0; i<3; i++)
scanf("%f",&arr[i]);
//To check wether the triplet is strictly increasing or decreasing or none.
if(arr[0]>arr[1]&&arr[1]>arr[2])
printf("1");
else if(arr[2]>arr[1]&&arr[1]>arr[0])
printf("1");
else
printf("0");
}
Saturday, August 1, 2020
GTA San Andreas 2.00 Full Apk + Data for Android 2020
- Remastered, high-resolution graphics built specifically for mobile including lighting enhancements, an enriched color palette and improved character models.
- Cloud save support for playing across all your mobile devices for Rockstar Social Club Members.
- Dual analog stick controls for full camera and movement control.
- Three different control schemes and customizable controls with contextual options to display buttons only when you need them.
- Compatible with the MoGa Wireless Game Controllers and select Bluetooth and USB gamepads.
- Integrated with Immersion tactile effects.
- Tailor your visual experience with adjustable graphic settings.
http://support.rockstargames.com/hc/en-us/sections/200251868-San-Andreas-Mobile-Support
www.wardrumstudios.com
Download APK file
Tuesday, July 28, 2020
Solving your first problem in C++ on CodeChef
Problem Name : Life, the Universe, and Everything
How to solve this question?
In this question they telling us to take the input of a number and display that number, repeat this proedure till we encounter number 42. After that we need to stop.
Solution :
#include <iostream>
using namespace std;
int main() {
// your code goes here
int number;
cin>>number;
while(number!=42)
{
cout<<number<<endl;
cin>>number;
}
return 0;
}