Monday, September 14, 2020
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;
}
Sunday, July 26, 2020
Introduction to Programming in C week 0 assignment(jul-dec 2020)
Question 1 :
#include<stdio.h>
int main()
{
printf("Hello C");
return 0;
}
Question 2 :
#include<stdio.h>
int main()
{
int a,b;
scanf("%d%d",&a,&b);
int avg = (a+b)/2;
printf("%d",avg);
return 0;
}
Tuesday, April 7, 2020
PROGRAMMING IN JAVA WEEK 10
import java.*;
import java.sql.*;
// Open a connection and check connection status
conn = DriverManager.getConnection(DB_URL);
if(conn.isClosed())
System.out.print("false");
else
System.out.print("true");
QUESTION 3:
import java.sql.*;
import java.util.Scanner;
import java.lang.*;
public class Question103 {
public static void main(String args[]) {
try {
Connection conn = null;
Statement stmt = null;
String DB_URL = "jdbc:sqlite:/tempfs/db";
System.setProperty("org.sqlite.tmpdir", "/tempfs");
conn = DriverManager.getConnection(DB_URL);
conn.close();
System.out.print(conn.isClosed());
}
catch(Exception e){ System.out.println(e);}
}
}
// The statement containing SQL command to create table "players"
String sql = "CREATE TABLE PLAYERS "+
"(UID INT, "+
"First_Name VARCHAR(45), "+
"Last_Name VARCHAR(45), "+
"Age INT, "+
" PRIMARY KEY(UID))";
// Execute the statement containing SQL command below this comment
stmt.executeUpdate(sql);
// Write the SQL command to rename a table
String str = "alter table PLAYERS rename to SPORTS";
// Execute the SQL command
stmt.executeUpdate(str);