Friday, December 9, 2016

Star Pattern-II - Placement Practice Questions @ C/C++

Special Thanks to - Rishubh Pratap Singh

A. Output 


B. Code in C 


#include <stdio.h>

int main()
{
int i,j,n;
printf("Enter the number of rows");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
for(j=n;j>=i;j--)
{
            printf(" * ");
        }
printf("\n");
}
return 10;

}

Star Pattern-I - Placement Practice Questions @ C/C++

Special Thanks to - Rishubh Pratap Singh

A. Output 



B. Code in C 

#include <stdio.h>

int  main()
{
int i,j,n;
printf("Enter the number of rows");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
for(j=1;j<=i;j++)
{
  printf(" * ");
}
printf("\n");
}
return 0;
}

Monday, December 5, 2016

Objective Questions in >= Swift2.2 @iPhone - Set J

Q.91: Which function is used to store URL preferences
A. func setFloat(Float Value ,  "KeyName")
B. func setDouble(Double Value ,  "KeyName")
C.  func setObject(value: AnyObject?,  "KeyName")
D.  func setURL(url: NSURL?, "KeyName")

Q.92: In func setBool(Bool Value , "KeyName") what will            be the keyname
  A. Integer Type
  B. Character type
  C. String Type
  D. Boolean type

Q.93: In func setObject(value:AnyObject?, "KeyName")               what will be the keyname
  A. Integer Type
  B. Character type
  C. Object type
  D. String Type

Q.94: What is the use of UIWebView class in iPhone
  A. To embed web content
  B. To render web content
  C. To load HTML pages
  D. All the above

Q.95: Which function is used load HTML content in    
        webview
  A. func loadHTMLString(_ string: String, baseURL:   
                                                         URL?)
  B. func loadHTMLString(baseURL: URL?)
  C. func loadHTMLString(_ string: String)
  D. None

Q.96: In the below function what can be   
         textEncodingName
func load(_ data: Data,  mimeType MIMEType: String, textEncodingName: String, baseURL: URL)

A.   utf-8
B.   utf-16
C.  A & B
D.  none

Q.97: In CGPointMake( value1 , value2) the type of value1 
          and value 2 is
  A. Float , Int
  B. Float , Float
  C. Int , Int
  D. Int , Float

Q.98: Which method is called when the view is actually 
         visible, and can be called multiple times during the 
         lifecycle of a View Controller.
  A. viewDidAppear()
  B. viewDidLoad()
  C. viewDidLayoutSubviews()
  D. None

Q.99: Which method is called once all of your subviews have 
           been laid out.
  A. viewDidAppear()
  B. viewDidLoad()
  C. viewDidLayoutSubviews()
  D. None

Q.100: Which class Is used to create session in swift
  A. NSURL
  B. NSURLSession
  C. NSURLRequest
  D. None


Answers:  D     C     D       D     A      C      B      A       C       B    

Objective Questions in >= Swift2.2 @iPhone - Set I

Q.81: Which method is used to invoke a method by timer after a 
          interval
        A. NSTimer.scheduledTimerWithTimeInterval(interval, 
            target: AnyClassselector: Selector(“increaseTimer),  
           userInfo: Any?, repeats: Boolean)
        B. NSTimer.scheduledTimerWithTimeInterval(target:
            AnyClassselector: Selector(“increaseTimer),  
           userInfo: Any?, repeats: Boolean)
        C. NSTimer.scheduledTimerWithTimeInterval(interval,  
            selector: Selector(“increaseTimer),  userInfo: Any?
            repeats: Boolean)
          D. None

Q.82: What is UITableViewDelegate
            A. is a protocol you implement on your class to 
                receive UITableView events. 
            B. is a protocol you implement to provide data for 
                your UITableView .
            C. Both
            D. None

Q.83: What is UITableViewDataSource 
            A. is a protocol you implement on your class to 
                receive UITableView events. 
            B. is a protocol you implement to provide data for 
                your UITableView .
            C. Both
            D. None

Q.84: Which function is used to add number of rows in 
          TableView
            A. func tableView(tableView: UITableView
                  numberOfRowsInSection section: Int)
{
                             return intValue;  //intValue means a valid integer
}
B. func tableView(tableView: UITableView
     numberOfRowsInSection  section: Int) -> Int
{
                             return intValue;  //intValue means a valid integer
}
          C. func tableView(tableView:  ,  numberOfRowsInSection
              section: Int) -> Int
{
                             return intValue;  //intValue means a valid integer
}
          D.  None


Q.85: Which function is used to customize cell  with data source

A. func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> Int
{
    return cell; //cell should be created by you 
}
B. func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: ) -> UITableViewCell
{
    return cell; //cell should be created by you 
}
C. func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath)
     -> UITableViewCell
{
    return cell; //cell should be created by you 
}
D.   None

Q.86: In Q.85 what is the significant of NSIndexPath

A.   index of Base row of table
B.    index of clicked row in table
C.    number of cells in Table
D.   None


Q.87: How to create cell using prototype cell

A.   let cell = UITableViewCell(style: 
                   UITableViewCellStyle.Default
                   reuseIdentifier: "prototypecell")
B.    let cell = UITableViewCell(
                       UITableViewCellStyle.Default
                   reuseIdentifier: " prototypecell ")
C.    let cell = UITableViewCell(style: 
                   UITableViewCellStyle.Default
                   reuseIdentifier: )
D.   None

Q.88: How user preferences can be stored in iPhone
          A. by using UserDefaults class
          B. by using NSUser class
          C. by using NSUserDefaults class
          D. None

Q.89: Which method is used to set the value with user 
          preferences
          A.  setObject(forKey : “ key name”)
          B.  setObject( “ Value  “ , forKey : “ key name”)
          C. setObject( “ Value  “ , “ key name”)
                D. None
            
            Q.90: Which method is used to retrieve the value for 
                      a key named name
                        A.  objectForKey()
                        B. objectForKey().name
                        C. objectForKey(“name”)
                        D. None


     Answers   A    A     B     B     C     B     A    C    B     C    

Objective Questions in >= Swift2.2 @iPhone - Set H

Q.71: A _______________ is a visual         
         representation of the appearance and flow of            your application.
A.   viewDidLoad()
B.    Storyboard
C.   didReceiveMemoryWarning()
D.   None
Q.72: __________ and ___________  are macros defined to denote variables and methods that can be referred to in Interface Builder.
          A. IBAction
          B. IBOutlet
          C. Both
          D. None

Q.73:How do i get the text from UITextField into an Int variable ?

         A. var data = Int(yourtextField.text!)

                        B. var data =  yourtextField.text!
                        C. var data =  yourtextField.text()
                        D. var data =  Int(yourtextField.text()!)

                Q.74: How textfield is declared in iPhone

                        A.   var textField: UITextField!

                        B.  @IBAction var textField: UITextField!

                        C.  @IBOutlet var textField: UITextField!

                        D. None
                Q.75: How function mapped with button is                
                        declared in iPhone App development

A. @IBAction func fun_name(sender: AnyObject) {}

B. @IBOutlet func fun_name () {

C. @IBAction  fun_name (sender: AnyObject) {

D. None

Q.76: How set text onto a UILabel

        A. labelName = “Hello Jaipur”

        B. labelName.setText = “Hello Jaipur”

        C. labelName.text  = “Hello Jaipur”

        D. None

Q.77: Which one is not the property of Navigation 

          Bar

        A. It appears at the top of an app screen

        B. It appears below the status bar

        C. Enables Navigation

        D. None

Q.78: Which one is not the property of ToolBar

        A. It appears at the bottom of an app screen

        B. It appears below the status bar

        C. Contains buttons

        D. None

Q.79: How to create timer in iPhone using swift

        A.  var timer = NSTimer()

        B. var timer = NStimer()

        C. var timer = Timer()

        D var timer = Timer

Q.80: How do I stop a timer

        A. timervariable.stop

        B. timervariable.stop()

        C. timervariable.invalidate

        D. timervariable.invalidate()


Answers : B    C    A    C    A    C     D     B     A     D