Showing posts with the label C programming exam question

C Programming Quiz online on input and output

This blog has been migrated to learn c programming for beginners

Following quiz provides Multiple Choice Questions (MCQs) related to C Programming input and output . You will have to read all the given answers and click over the correct answer. You are given 3 to 4 options , you have to click on option  until you are right.
1.What is difference between getch() and getche()?
getch() do not take'e'

getch() do not show input data in screen but getche() show input data in screen

getch() is used for all media but getche() is not.

Try again 2.scanf("%3f%4f",&x,&y);
Input is: 5.93 , 65.87
5.93 is stored in x and 65.87 is stored in y

Try again
5.9 is stored in x and 65.8 is stored in y

Try again
5.9 is stored in x and 3.00 is stored in y

WOW , you are write 3.What is use of escape character '\b'?
It backs the program

Try again
It moves the control to first position

Try again
It moves the cursor one position back

WOW , you are write 4.What is use of es…

Multidimensional array in c

A multinational company has hired 3 sales persons for marketing/selling its 3 different products in Kathmandu .Each sales person sells each of these products. Write a c program to read number of each product sold by all sales-persons. Calculate total sells of each item and the total sells of each sales-person . Use array C Program source code#include <stdio.h> #include <conio.h> #include <string.h> int main() { int pro[3][3],sum=0; int j ,i ; char per[3][10]={ "first","second","third"}; for (i=0 ; i<3 ; i++) { for(j=0 ; j<3 ; j++) { printf("enter number of selling of %s person %s product:" , per[i] ,per[j] ); scanf("%d", &pro[i][j]); printf("\n"); } } for (i=0 ; i<3 ; i++) { for(j=0 ; j<3 ; j++) { sum = sum + pro[j][i]; } printf("Total sell of %s item is:%d\n",per[i], sum); sum=0; } for (i=0 ; i<3 ; i++) { …